We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridGroupingControl NavigatorBar

Thread ID:

Created:

Updated:

Platform:

Replies:

63391 Jul 3,2007 04:19 PM UTC Oct 8,2007 05:29 AM UTC ASP.NET Web Forms (Classic) 5
loading
Tags: GridGroupingControl
rebecca
Asked On July 3, 2007 04:19 PM UTC

Hi,

I need to log the event when edit the content of the grid. How can I trigger an event when press the "delete row" and "edit row" button in the navigator bar?

Another question is how to code the DeleteParameters and UpdateParameters etc. in C# instead of in asp?

Thanks,
Rebecca


Gokul B [Syncfusion]
Replied On July 3, 2007 09:21 PM UTC

Hi Rebecca,

Here is my answer for your query.

* You can trigger the event once the EditRow/DeleteRow of the ButtonBarItem is pressed using the GridGroupingControl OnBarButtonItemClicked event. Please refer to the below code snippet.

In the GridGroupingControl BarButtonItemClicked event

//Execute the code if the DeleteRow/EditRow BarButtonItem is pressed.
if (e.ButtonBarItem.ButtonBarItemType == ButtonBarItemType.DeleteRow)
{
}
else if (e.ButtonBarItem.ButtonBarItemType == ButtonBarItemType.EditRow)
{
}

* If your intentions is to code the DeleteParameters of the DataSource Control from the code behind then please refer to the below code snippet.

AccessDataSource1.DeleteParameters.Add(@stringname,type of parameter,value);

Let us know if it helps.

Thanks for using Syncfusion products.

Regards,
Gokulkumar B

rebecca
Replied On July 5, 2007 04:20 PM UTC

Hi GokulKumar,

Thank you for your reply! New problems come up...

1. In the GridGroupingControl BarButtonItemClicked event, when i code only

if (e.ButtonBarItem.ButtonBarItemType == ButtonBarItemType.DeleteRow)
{
}
else if (e.ButtonBarItem.ButtonBarItemType == ButtonBarItemType.EditRow)
{
}

then other button such as "ChangePageSize","MoveNextPage","MoveLast" will not work properly, it seems I need to code for each button.

How can I only code for the button "EditRow" and "DeleteRow" and have other buttons work properly?

2. Can you give me an example for using AccessDataSource1.DeleteParameters.Add(@stringname,type of parameter,value); as in aspx, we only need to write 2 values like




3. How can I get the field value for current record in C# (i.e. when I delete or edit a row, i need to get the info of the row thus I can log it)?

Thanks,
Rebecca



Gokul B [Syncfusion]
Replied On July 5, 2007 09:20 PM UTC

Hi Rebecca,

Here is my response to your query.

1) We afraid we are not able to reproduce the issue as you mentioned. Could you please send us your sample which causes this issue. So that we could sort out the cause of the issue and provide you a solution.

2) After specifying the valid Delete command to DatasourceControl, you can call the below code snippet in the BarButtonItemClicked event.

if (e.ButtonBarItem.ButtonBarItemType == ButtonBarItemType.DeleteRow)
{
Record r = this.GridGroupingControl1.Table.CurrentRecord;
this.AccessDataSource1.DeleteParameters.Add("@id", r.GetValue("EmployeeID").ToString());
//Will automatically deletes the current record once the DeleteRow ButtonBarItem is pressed
this.AccessDataSource1.Delete();
}

3) You can read the value of the Current record row once the Save button of the ButtonBarItem is clicked using the below code snippet.

In the GridGroupingControl's CurrentRecordContextChange event

//Update the database once the editing is called.
if(e.Action == CurrentRecordAction.EndEditCalled)
{
//Ensures that AddNewRow is affected.
if(r.GetSourceIndex() == -1)
{
String str=r.GetValue("Columnname").ToString();
}
}

Attached is the sample in which the Current record value is retrieved at runtime.

http://websamples.syncfusion.com/samples/Grid.Web/5.1.0.51/F63391/GridGroupingControl_Forum63391/main.htm

Sample Description
------------------
* In our sample, we bind the GridGroupingControl with the AccessDatasourceControl.
* In the CurrentRecordContextChange event We have displayed the value of the AddnewRow in the ListBox once the Editing is completed.

Please try running the above sample and let me know if this helps.

Regards,
Gokulkumar B

Ivan Siew
Replied On September 28, 2007 03:51 PM UTC

Hi there,

have you guys tried getting the EndEditCalled event to fire when inserting a new row into a blank grid? It doesn't work. You get an exception. All your online samples show adding a new row to a grid that already has data. Try adding a new row to a blank grid. As I step through the code, I noticed that e.Action doesn't trap for the EndEditCalled event.

Please let me know how I can trap for that inserting a new row with no data already in the grid.

Ivan

Rajarajeswari S [Syncfusion]
Replied On October 8, 2007 05:29 AM UTC


Hi Ivan,

Please follow up with the Incident.

Regards,
S.Rajarajeswari

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;