-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: ShrinivasInDotNet
Message 3 in Discussion

Hi, I cannot send the project due to large size. But here is the function code. I am 
setting the respective table to the datagrid source. This bug happens in following 
steps
1) Cursor on datagrid cell
2) any other dialog is pop up on the grid, that dialog invokes file save dialog
3) press esc to file save dialog, this closes it as well as dialog behind
4) Focus on grid again, and code below gets executed where I am setting the datagrid 
source =  table DT, and try to navigate to the screen    
this.dgParameters.NavigateTo(screenNumber-1, "Screen_ParameterRow");
and here crashes, dgParameters datasource has the valid tables, No need to crash.. If 
initially cursor is not on grid, then with these steps, no crash..may be crash due to 
edit..?  System.Data.DataTable DT;
   System.Data.DataRow DR;    try
   {
    if(this.sourceData == null)
     throw new System.NullReferenceException("sourceData for WinGridParameters is 
null.");     DT = this.sourceData.Tables["Screen"];
    if (DT == null)
     throw new System.NullReferenceException("sourceData must contain a Screen 
table");     if (DT.Rows.Count < 1)
     throw new System.IndexOutOfRangeException("sourceData must have at least one 
screen defined in the data set");     // Rows array is zero based.
    DR = DT.Rows[screenNumber-1];     if(DR["Caption"] != null)
    {
     this.dgParameters.CaptionText = DR["Caption"].ToString();
    }     
    this.dataMonitoringController.RemoveUnsupportedParameters();
    
   
    bool monitorActive = false;
    if (dataMonitoringController.MonitoringEnabled == true)
    {
     dataMonitoringController.MonitoringEnabled = false;
     monitorActive = true;
    }     dataMonitoringController.RemoveAllWatchs(); 
    string keyName;
    string units;     System.Data.DataRow[] rows = 
DT.Rows[screenNumber-1].GetChildRows("Screen_ParameterRow");     
foreach(System.Data.DataRow dataRow in rows)
    {
     try
     {
      keyName = dataRow["Name"].ToString();
      units = dataRow["Unit"].ToString();       if(keyName.Length > 0)
      {
       dataMonitoringController.AddWatch(keyName, units);
      }
      else
      {  // do nothing, no param name on this line
      }       keyName = dataRow["Name2"].ToString();
      units = dataRow["Unit2"].ToString();       if(keyName.Length > 0)
      {
       dataMonitoringController.AddWatch(keyName, units);
      }
      else
      { // do nothing, no param name on this line
      }
     }
     catch( System.Exception e )
     {
     }
     if (monitorActive == true)
     {
      dataMonitoringController.MonitoringEnabled = true;
     }
    }     this.dgParameters.DataSource = DT;
    this.dgParameters.NavigateBack();
    this.dgParameters.NavigateTo(screenNumber-1, "Screen_ParameterRow");
    this.DefaultGridRows();
   }
   catch (System.Exception e)
   {
    //throw e;
    MessageBox.Show(e.Message);  
   }
   this.currentScreen = screenNumber; Thanks

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to