Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
240
How to set different MaxValue for WebDateTimeEdit in different rows in a UltraWebGrid?
posted

1)  In my InitializeLayout event for the UltraWebGrid, I have the following code:

e.Layout.Bands[0].Columns[10].EditorControlID = WebDateTimeEdit1.UniqueID;

e.Layout.Bands[0].Columns[10].Type = Infragistics.WebUI.UltraWebGrid.ColumnType.Custom;

 

2) The grid has two date values: 1) start_date and 2) end_date.   The start_date has a read-only value. The value for the end_date can be set from selecting a value from the WebDateTimeEdit control.  The end_date value varies based on what the start_date is.

3) In what client-side event would I be able to set the MaxValue for each row's display of WebDateTimeEdit control?

scenario:

for row1: start_date = 1/1/2008   -- on clicking the WebDateTimeEditControl, the MaxValue input should be = 1/10/2008

for row2: start-date = 2/1/2008 -- on clicking the WebDateTimeEditControl, the MaxValue input should be = 2/10/2008

Thanks

CR

 

Parents
  • 240
    Verified Answer
    posted

    Please ignore.. This is now closed. Here's the resolution - a new javascript function for ClientSideEvents --  BeforeCellChangeHandler="ug_BeforeCellChange" :

    function ug_BeforeCellChange(gridName, cellId)

    {

    var cell = igtbl_getCellById(cellId);

    if (cell.Column.Key="end_date")

    {

    var row = igtbl_getRowById(cellId);

    var editor = igedit_getById("WebDateTimeEdit1");

    var dt = new Date();

    dt = row.getCell(7).getValue(); //get start date

    var newdt = new Date(dt.getTime() + 30*24*60*60*1000); //add 30 days to the start date

    editor.setMaxValue(newdt);

    }}

     

Reply Children
No Data