Hi,
i'm using a datagrid and i want to by clicking right click a context web data menu appear to edit the selected row in the datagrid and then when i choose an item from the context data menu i need an modal popup appear containing the informations to insert it to datagrid ! thanks in advance
Hello safa dkl,
What I can suggest for achieving your requirement is using the WebDataMenu as your context menu and display it ot the right click of the mouse.
[code]
<ig:WebDataMenu runat="server" ID="ContextMenu" IsContextMenu="true" BorderStyle="Solid" BorderWidth="1" BorderColor="#CCCCCC"> <ClientEvents ItemClick="MenuItem_Click" /> <Items> <ig:DataMenuItem Text="Select Current Row" Key="Select" ImageUrl="/SamplesBrowser/SamplesCommon/aspnet/WebDataGrid/EditingAndSelection/RowContextMenu/sendto.png" /> <ig:DataMenuItem Text="Edit" Key="Edit" ImageUrl="/SamplesBrowser/SamplesCommon/aspnet/WebDataGrid/EditingAndSelection/RowContextMenu/edit.png" /> <ig:DataMenuItem Text="<%$ Resources:WebDataMenu, ContextMenuDelete %>" Key="Delete" ImageUrl="/SamplesBrowser/SamplesCommon/aspnet/WebDataGrid/EditingAndSelection/RowContextMenu/stop.png" /> </Items> </ig:WebDataMenu>
[/code]
Regarding your second requirement what I reccommend is making a template with textboxes for the values of the grid cells and manually bind them with the corresponding fields of the grid.
<ClientBindings> <ig:RowEditingClientBinding ColumnKey="CompanyName" ControlID="control1" GetValueJavaScript="$get({ClientID}).value" SetValueJavaScript="$get({ClientID}).value={value}" /> <ig:RowEditingClientBinding ColumnKey="Contact" ControlID="control2" GetValueJavaScript="$get({ClientID}).value" SetValueJavaScript="$get({ClientID}).value={value}" /> <ig:RowEditingClientBinding ColumnKey="Address" ControlID="control3" GetValueJavaScript="$get({ClientID}).value" SetValueJavaScript="$get({ClientID}).value={value}" /> <ig:RowEditingClientBinding ColumnKey="City" ControlID="control4" GetValueJavaScript="$get({ClientID}).value" SetValueJavaScript="$get({ClientID}).value={value}" /> <ig:RowEditingClientBinding ColumnKey="PostalCode" ControlID="control5" GetValueJavaScript="$get({ClientID}).value" SetValueJavaScript="$get({ClientID}).value={value}" /> <ig:RowEditingClientBinding ColumnKey="Country" ControlID="control6" GetValueJavaScript="$get({ClientID}).value" SetValueJavaScript="$get({ClientID}).value={value}" /> </ClientBindings>
A sample project demonstrating your scenario could be found at:
https://www.infragistics.com/samples/aspnet/data-grid/row-context-menu
Feel free to contact me if you need any further support.
I hope you find my information helpful.
Please do not hesitate to contact me if you have any additional questions regarding this matter.
My dataset is plain datatable and grid's columns are auto generating. How can I bring context menu to my grid ?