Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > deleting rows in repeater control

Reply
Thread Tools

deleting rows in repeater control

 
 
Imran Aziz
Guest
Posts: n/a
 
      08-04-2005
Hello All,
Is there a way to delete rows from a repeater control using any build in
features?
Imran.


 
Reply With Quote
 
 
 
 
Craig Deelsnyder
Guest
Posts: n/a
 
      08-04-2005
On Thu, 04 Aug 2005 10:14:34 -0500, Imran Aziz <(E-Mail Removed)> wrote:

> Hello All,
> Is there a way to delete rows from a repeater control using any
> build in
> features?
> Imran.
>
>


You could delete the row/item from the datasource and rebind...

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
 
Reply With Quote
 
 
 
 
Imran Aziz
Guest
Posts: n/a
 
      08-05-2005
Thanks thats what I am doing now.
Imran.
"Craig Deelsnyder" <cdeelsny@no_spam_4_meyahoo.com> wrote in message
news(E-Mail Removed) ...
> On Thu, 04 Aug 2005 10:14:34 -0500, Imran Aziz <(E-Mail Removed)> wrote:
>
>> Hello All,
>> Is there a way to delete rows from a repeater control using any
>> build in
>> features?
>> Imran.
>>
>>

>
> You could delete the row/item from the datasource and rebind...
>
> --
> Craig Deelsnyder
> Microsoft MVP - ASP/ASP.NET



 
Reply With Quote
 
pwhe23 pwhe23 is offline
Junior Member
Join Date: Jun 2008
Posts: 1
 
      06-29-2008
If you don't mind using reflection, this works for me:
Code:
//get private field ArrayList in RepeaterItemCollection
var items = repeater.Items.Get<ArrayList>("items");
...
//manipulate items however you want
Get is an extension method I put on Object in my projects to make reflection easy
Code:
public static T Get<T>(this Object obj, String name) {
	BindingFlags flags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy;
	if (obj == null) return default(T);
	var prop = obj.GetType().GetProperty(name, flags);
	if (prop != null) return (T)prop.GetValue(obj, null);
	var field = obj.GetType().GetField(name, flags);
	if (field != null) return (T)field.GetValue(obj);
	return default(T);
}
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can we inject rows in a repeater control? gnewsgroup ASP .Net 7 10-31-2007 06:24 PM
Repeater Control - 3 Columns - Unlimited Rows Peggy ASP .Net 1 05-17-2007 06:52 PM
Active Count of Rows using Repeater Control (ASP.NET VB) RC- ASP .Net 5 04-27-2007 06:58 PM
Use of "Repeater" control to loop through data rows donnet ASP .Net Web Controls 2 01-17-2005 07:38 PM
Repeater Control: How to repeat in rows of x? SamIAm ASP .Net 5 01-07-2004 06:00 PM



Advertisments