Hello
i have some problem about gridvieuw
first :
how to make a columns to Unselectable stat?,i want to prevent the user to clicking on some columns
the second
to solve the first problem I use this method :
the main objectf is to click on specefic cells and capture the value to use in a sql query,so i need to capture the adequate value for the query works.
here is the code :
The code work fine ,the first time when i click in other cells nothing happens,and when i click in a specefic cells (Cell ID in my case) the contextmenu appears normally and this is the main objectif,but after this when i reclick in the other cell the contextmenu appears also,and this is my problem,the contextmenu must appears only when i click in a specific columns.
so,how to prevent this to happen?
thanks a lot
i have some problem about gridvieuw
first :
how to make a columns to Unselectable stat?,i want to prevent the user to clicking on some columns
the second
to solve the first problem I use this method :
the main objectf is to click on specefic cells and capture the value to use in a sql query,so i need to capture the adequate value for the query works.
here is the code :
void GridViewKPI_MouseDown(object sender, MouseButtonEventArgs e) { RadContextMenu radContextMenu = new RadContextMenu(); if (GridViewKPI.CurrentCell.Column.UniqueName == "Cell ID") { TBox_CellID.Text = GridViewKPI.CurrentCell.Value.ToString(); RadMenuItem copyItem = new RadMenuItem(); copyItem.Header = "Show In chart"; radContextMenu.Items.Add(copyItem); RadMenuItem pasteItem = new RadMenuItem(); pasteItem.Header = "Show in Ho Stat"; radContextMenu.Items.Add(pasteItem); RadMenuItem cutItem = new RadMenuItem(); cutItem.Header = "Show in Map"; radContextMenu.Items.Add(cutItem); RadContextMenu.SetContextMenu(this.GridViewKPI, radContextMenu); } //else radContextMenu.Items.Remove(copyItem); }so,how to prevent this to happen?
thanks a lot