1

I have a Repeater and inside it a GridView. Now I want to to fire GridView's RowCommand. So can any one tell me how can it be?

Josh Darnell
  • 11,304
  • 9
  • 38
  • 66
Ram Singh
  • 6,664
  • 35
  • 100
  • 166
  • 3
    "A RowCommand is used to capture and process a button click contained within a Row of a GridView.Thanks – Ram Singh Oct 03 '11 at 12:33

2 Answers2

2

What it sounds like you want to do is handle the RowCommand event in each of your GridViews.

One way to do this would be to create an event handler for the ItemCreated event in the Repeater control. In that event handler, you could then add the RowCommand event handler to each GridView using += syntax. So, if your RowCommand event handler method is called "GridView1_RowCommand", you could do this:

Repeater1_ItemCreated(Object Sender, RepeaterItemEventArgs e)
{

    GridView tempGV = (GridView)e.Item.FindControl("GridView1");
    tempGV += GridView1_RowComamnd;

}

Then, each time a RowCommand event is fired from one of your GridViews, the GridView_RowCommand event will be called.

DreamTeK
  • 32,537
  • 27
  • 112
  • 171
Josh Darnell
  • 11,304
  • 9
  • 38
  • 66
1

Refer to this site, where a similar discussion is done.