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. Image for the cookie policy date
close icon

dropdowncalendarcontrol in grid

when inserting a new record via gridgrouping, how do I do a 'findcontrol(dropdowncalendar) to retrieve my date.

The findcontrol does not seem to be working for me..

Thanks, Tim


1 Reply

AD Administrator Syncfusion Team February 12, 2008 11:41 AM UTC

Hi Tim,

Sorry for the delay in responding.

How do I do a 'findcontrol(dropdowncalendar) to retrieve my date?

You can use the below code snippet to retrieve the date :

[C#]
protected void GridGroupingControl1_BarButtonItemClicked(object source, Syncfusion.Web.UI.WebControls.Grid.Grouping.ButtonBarItemClickEventArgs e)
{
if (this.GridGroupingControl1.TableDescriptor.FormEditMode != TableEditMode.UseTemplateForm && this.GridGroupingControl1.TableDescriptor.FormEditMode != TableEditMode.UseInlineTemplateForm)
return;

if (e.ButtonBarItem.ButtonBarItemType == ButtonBarItemType.Save)
{
Record curRecord = this.GridGroupingControl1.FormEditCell.CurrentRecord;

TextBox tb = this.GridGroupingControl1.FormEditCell.FindControl("OrderID") as TextBox;
if (tb.Enabled)
curRecord.SetValue("OrderID", tb.Text);

tb = this.GridGroupingControl1.FormEditCell.FindControl("CustomerID") as TextBox;
curRecord.SetValue("CustomerID", tb.Text);

tb = this.GridGroupingControl1.FormEditCell.FindControl("OrderDate") as TextBox;
curRecord.SetValue("OrderDate", tb.Text);

this.GridGroupingControl1.Table.EndEdit();
e.Handled = true;
}

}


Also, Please refer the sample in the below link which illustrates the above:

http://websamples.syncfusion.com/samples/Grid.Web/6.1.0.34/71666/main.htm

Please try this and let me know if this helps.

Regards,
G.Yavana




Loader.
Live Chat Icon For mobile
Up arrow icon