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. (Last updated on : November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Query Related to AddNewRecordBeforeDetails

Thread ID:

Created:

Updated:

Platform:

Replies:

126323 Oct 7,2016 09:04 AM UTC Oct 10,2016 12:35 PM UTC WinForms 1
loading
Tags: GridGroupingControl
Paurnima
Asked On October 7, 2016 09:04 AM UTC

Hi,
I am using grid grouping control with AddNewRecordBeforeDetails property is true.I have two queries related to this property.
1)when i entered some value in any column and backspace it on enter key press it also adds blank record in grid grouping control.I don't want any blank row .
2) I want to add new record based on certain condition only,
such as,
 If the combo box column in my grid having value


Thanks and Regards,
paurnima.






Piruthiviraj Malaimelraj [Syncfusion]
Replied On October 10, 2016 12:35 PM UTC

Hi Paurnima, 

Thanks for your interest in Syncfusion products. 

We had analyzed your reported scenario. In order to  add the new record based on some criteria , you can use RecordValueChanging event and you can check record kind by using Record.Kind property. Please make use of the below code and refer to the attached sample. 
 
Code example 
this.gridGroupingControl1.RecordValueChanging += new RecordValueChangingEventHandler(gridGroupingControl1_RecordValueChanging); 
 
void gridGroupingControl1_RecordValueChanging(object sender, RecordValueChangingEventArgs e) 
{ 
    if (e.Record.Kind == DisplayElementKind.AddNewRecord) 
    { 
        GridCurrentCell cc = this.gridGroupingControl1.TableControl.CurrentCell; 
 
        object value = e.Record.GetValue("CategoryName"); 
 
        if (cc.MoveToRowIndex != cc.MoveFromRowIndex) 
        { 
            if (value == null) 
            { 
                e.Cancel = true; 
            } 
        } 
    } 
} 
 
Sample link 
 
Regards, 
Piruthiviraj 
 


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

;