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?
Asked
Active
Viewed 2,834 times
1

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 Answers
2
What it sounds like you want to do is handle the RowCommand
event in each of your GridView
s.
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 GridView
s, 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.

Sai Kalyan Kumar Akshinthala
- 11,704
- 8
- 43
- 67
-
3While this may theoretically answer the question, [it would be preferable](http://meta.stackexchange.com/q/8259) to include the essential parts of the answer here, and provide the link for reference. – Bill the Lizard Oct 03 '11 at 12:47
-
Ok, @BilltheLizard thanks for your suggestion I will follow from now. – Sai Kalyan Kumar Akshinthala Oct 03 '11 at 12:57