Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
24507 | Feb 4,2005 08:26 PM UTC | Feb 6,2005 07:52 PM UTC | WinForms | 1 |
![]() |
Tags: GridControl |
this.gridDataBoundGrid1.Binder.EditModeChanged += new EventHandler(Binder_EditModeChanged);
private void Binder_EditModeChanged(object sender, EventArgs e)
{
Syncfusion.Windows.Forms.Grid.GridModelDataBinder binder = sender as Syncfusion.Windows.Forms.Grid.GridModelDataBinder;
if (binder.IsAddNew)
{
int rowIndex = binder.CurrentRowIndex;
this.gridDataBoundGrid1.Model[rowIndex, 5].CellValue = System.DateTime.Now;
}
}
Stefan
>Greetings,
>
>I have a date column in a databound grid I am setting up with the following code.
>
>this.gridData.Model.ColStyles[5].CellType = "DropDownMonthCalendar";
> this.gridData.Model.ColStyles[5].CellValue = System.DateTime.Now;
>
>As you can see I want to default in todays date for all new rows in the grid. This is a bulk entry screen.
>
>The odd behavior I am experiencing is the following:
>- When the screen is first loaded the first row is empty with the exception of the date column(this is what I want). As soon as I type in or select another column on this row the grid makes a new row(I have the enable add new property set to true) and removes the date value from my first row(what I don''t want).
>
>Essentially, I want this date column to default to today''s date for all new rows added, but allow the user to change it if they want.
>
>Cheers,
>JF
>
> 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.
This page will automatically be redirected to the sign-in page in 10 seconds.