| <ImageManager ViewPaths="~/img" /> |
protected
void ImageButtonTest_Click(object sender, ImageClickEventArgs e)
{
ImageButton imageButton = (ImageButton)sender;
TableCell tableCell = (TableCell)imageButton.Parent;
GridViewRow row = (GridViewRow)tableCell.Parent;
string id = GridViewTest.DataKeys[row.RowIndex].Values[0].ToString();
...
This is the column order in my grid.
SP Full Name, Email, Job Title, Location, Resume, Organization
I'm reordering the column "SP Full Name" to come after "Job Title". (As shown in attachment)
But the columns gets reordered as below,
Email, Job Title, Location, SP Full Name, Resume, Organization
The "Location" column should stay after the "SP Full Name" column. Right?
What i am doing wrong?
Please somebody help me with this issue.
This is my ClientSettings Code Block
| <ClientSettings ColumnsReorderMethod="Reorder" ReorderColumnsOnClient="true" AllowColumnsReorder="true" |
| EnableRowHoverStyle="false" AllowDragToGroup="true"> |
| <Resizing AllowColumnResize="True" EnableRealTimeResize="True" ResizeGridOnColumnResize="True" /> |
| </ClientSettings> |
#region gvLUs_UpdateCommand event protected void gvLUs_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) { //Get the GridEditableItem of the RadGrid GridEditableItem editedItem = e.Item as GridEditableItem; // Build our Update string string strUpdate = ""; string strWhere = ""; int ic = 0; GridColumn editColumn; for (int i=0; i<gvLUs.MasterTableView.AutoGeneratedColumns.Count(); i++) { ic++; if (i == 0) { // Get our PK column editColumn = gvLUs.MasterTableView.AutoGeneratedColumns[i]; LU.ID = editColumn.UniqueName.ToString(); LU.IDValue = Convert.ToInt32((editedItem[editColumn].Controls[0] as TextBox).Text); // Add to our UPDATE string strUpdate = "UPDATE " + LU.TableName + " SET "; strWhere = " WHERE " + LU.ID + " = " + LU.IDValue.ToString(); } else { if (ic != gvLUs.MasterTableView.AutoGeneratedColumns.Count()) { // Get other values to be updated editColumn = gvLUs.MasterTableView.AutoGeneratedColumns[i]; strUpdate += editColumn.UniqueName.ToString() + " = '" + (editedItem[editColumn.UniqueName].Controls[0] as TextBox).Text + "' ,"; } else { // Get other values to be updated editColumn = gvLUs.MasterTableView.AutoGeneratedColumns[i]; strUpdate += editColumn.UniqueName.ToString() + " = '" + (editedItem[editColumn.UniqueName].Controls[0] as TextBox).Text + "'"; } } }