How to use LinkButton in GridView.
-
Dear Programmers, I am getting mad now to get what I want. I have searched 100 of articles but not found my desired one. I am using a gridview and want to give use a linkbutton as providing the option to the user to move the data of the rows of gridview up and down. To give a better understanding I am giving you an example. I want that if user press the Up (LinkButton) Button on the gridview in second row than the data of second row will be shifted to first row and data of first row will be shifted to the second row. I am also giving you my code. In this I only want to get the indexposition or row position on which I am pressing the Up or Down Button. Please Help me to get rid of it otherwise I will be get mad because I am trying to get this from more than a week. My code of gridivew is: Width="400px" > ]]>'> Visible="<%# IIf(CType(Container, GridViewRow).RowIndex = 0, false, true) %>" > Visible='<%# IIf(CType(Container, GridViewRow).RowIndex =8, false, true) %>' > Please friends help me. I will be thankful to all those in advance who will reply me. Th
-
Dear Programmers, I am getting mad now to get what I want. I have searched 100 of articles but not found my desired one. I am using a gridview and want to give use a linkbutton as providing the option to the user to move the data of the rows of gridview up and down. To give a better understanding I am giving you an example. I want that if user press the Up (LinkButton) Button on the gridview in second row than the data of second row will be shifted to first row and data of first row will be shifted to the second row. I am also giving you my code. In this I only want to get the indexposition or row position on which I am pressing the Up or Down Button. Please Help me to get rid of it otherwise I will be get mad because I am trying to get this from more than a week. My code of gridivew is: Width="400px" > ]]>'> Visible="<%# IIf(CType(Container, GridViewRow).RowIndex = 0, false, true) %>" > Visible='<%# IIf(CType(Container, GridViewRow).RowIndex =8, false, true) %>' > Please friends help me. I will be thankful to all those in advance who will reply me. Th
Although i haven`t worked with a scnerio as above , I once designed a page where the grid contains a dropdownlist and on its selection change i had to get its index. Following is the code... ASPX Page .... .... ASPX.CS protected void DropDown_SelectedIndexChanged(object sender, EventArgs e) { DropDownList list = (DropDownList)sender; TableCell cell = list.Parent as TableCell; DataGridItem item = cell.Parent as DataGridItem; i=item.ItemIndex;//you get the item index.. .... .... When you fail to plan, you are planning to fail.