Hi
I want that aspose grid should work like excel. Aftre binding with dataset on runtime when i am adding a new row ,it added in the last of grid .on click of column ,column not selected.and no option of client side sorting .
Actually I want to trap each and every movement of user on the grid like inserting a new column,or row and sorting , copy, paste and want to save all the actions of user in the database.
Can we do that with the help of Aspose grid.
Please reply soon.we have immediate requirment.Please...........
Hi,
Well, clicking on a row header will select the whole column selection of columns (clicking on a column header) is not supported for GridWeb, it is supported in GridDesktop though. For client side sorting, we will look into it and update you soon. I think you may try some apis for the task e.g
GridWeb1.WebWorksheets[0].Cells.InsertColumn(columnIndex);
pksy2kk7:
Actually I want to trap each and every movement of user on the grid like inserting a new column,or row and sorting , copy, paste and want to save all the actions of user in the database.
Well, you may try to select and handle some events for your need, e.g RowInserted, ColumnInserted, InitializeNewBindRow etc. You can also utilize some client events e.g onCellUpdated, onCellSelected etc.
For reference, please check clientsideevents demo in Scripting category in our featured demos.
Thank you.
I have aquetion that I want to trap the events of the user and save them in to the database whatever user has done with the grid.
How can Ii do this??? and
For that purpose what is useful,dinding grid with dataset or importing through dataset. Remember I want to save all changes in database.
Hi,
I think you may use data binding feature of GridWeb control, there is an event i.e.., InitializeNewBindRow of GridWeb control that you may handle if you need.
e.g
private void GridWeb1_InitializeNewBindRow(Aspose.Grid.Web.Data.WebWorksheet sender, object bindObject)
{
//Assign some default values for some columns (in the datatable) when new row gets entered in data binding mode
((DataRowView)bindObject)["CreatedDate"] = DateTime.Today;
((DataRowView)bindObject)["ProductName"] = "NAME";
}
Note: Generally, the sheet's DataSource is a DataSet or DataTable object, and the bindObject is a DataRowView object.
You may add custom command buttons for "add", "delete", "save" operations and handle GridWeb's CustomCommand event.
Please check some articles for your reference:
http://www.aspose.com/documentation/visual-components/aspose.grid-for-.net/binding-worksheet-to-a-dataset-using-gridwebs-worksheets-designer.html
http://www.aspose.com/documentation/visual-components/aspose.grid-for-.net/binding-worksheet-to-a-dataset-at-run-time-using-gridweb.html
Thank you.
Thanks for quick reply
but how can I find out selected cell id?
and how can we hide the context menu already provided.
Hi,
pksy2kk7:
but how can I find out selected cell id?
Well, you may try to use GridWeb1.ActiveCell.Row or GridWeb1.ActiveCell.Column attribute. Also, on client side, you may utilize getActiveCell function of GridWeb control. For reference please check the source codes of the Scripting demos to check client side functions: `http://www.aspose.com/demos/visual-components/aspose.grid/csharp/demos/scripting/default.aspx`
pksy2kk7:
and how can we hide the context menu already provided.
Well, currently, you may rename menu items. You can also remove/hide some menu items, the procedure is a simple one. i.e.,
Create a new javascript language file same like "lang_en.js" (You may also update the existing "lang_en.js" file. but this method is not recommended) which is stored in stored by default in the ...\Program Files\Aspose\Aspose.Grid\agw_client folder,
Open it into notepad and edit it to Save it As for your need. You may comment out the related line(s) e.g., //MenuItemCopy :"Copy", so that the option will not be shown in the context menu when the user utilizes the right click menu of the gridweb.
In your code you may try to set the code: GridWeb1.AGWLanguageFileUrl = "`http://localhost/DemoApplication/lang_ennew.js`";
Thank you.