Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Bind Repeater's DataRow to GridView's DataSource

Reply
Thread Tools

Bind Repeater's DataRow to GridView's DataSource

 
 
wardemon
Guest
Posts: n/a
 
      11-30-2006
Hi All,
I was just wondering if the following is possible? To bind a
GridView's datasource to the Repeater's current DataRow value.

I tried creating a dataset, then load the datarowview inside it,
however, this method would require a lot of things to do like, create a
table, create columns for it, etc..

I was wondering if there is more of a direct way to feed GridView's
..DataSouce to the Repeater's e.Item.ItemType's data.

Thanks,
Henry




public void Main_OnItemDataBound(object sender,
RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
ListItemType.AlternatingItem)
{

((GridView)e.Item.FindControl("gvwColumnDescriptio ns")).DataSource =
((DataRowView)e.Item.DataItem);

((GridView)e.Item.FindControl("gvwColumnDescriptio ns")).DataBind();

}

}

 
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
Is it possible to bind a datarow to the value of a DDL? RSH ASP .Net 2 09-21-2006 12:35 PM
Accessing the current DataRow of the DataSource from ItemDataBound Nathan Sokalski ASP .Net 5 09-25-2005 02:10 PM
Accessing the current DataRow of the DataSource from ItemDataBound Nathan Sokalski ASP .Net Web Controls 5 09-25-2005 02:10 PM
Accessing the current DataRow of the DataSource from ItemDataBound Nathan Sokalski ASP .Net Datagrid Control 5 09-25-2005 02:10 PM
Datarow can't bind to datagrid...I need a workaround HelpPlease ASP .Net Web Controls 2 02-12-2004 06:20 AM



Advertisments