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
275
DataRecord cell exists?
posted

Hello

Is there a way to check if a cell in a DataRecord exists? I have the following code:

void grid_InitializeRecord(object sender, Infragistics.Windows.DataPresenter.Events.InitializeRecordEventArgs e)
        {
            if (e.Record is DataRecord)
            {
                DataRecord dr = (DataRecord)e.Record;
                try
                {
                    dr.Cells["No."].Value = (e.Record.Index + 1).ToString();
                }
                catch (Exception ex) { }
            }
        }

 

and I want to remove the try/catch and replace it with something like

if (dr.Cells["No."].Exists) { }

Is there any way to do this?

Many thanks

Kostas.

Parents
No Data
Reply Children