Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Am I doing the resource access wrong
Message
From
19/07/2007 15:03:19
 
 
To
19/07/2007 13:28:27
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01241787
Message ID:
01242106
Views:
20
Having solved that problem... I can now see that my fear about cdsMessageDataSet.Messages[iRow].msgtype not working correctly after a sort ect was well founded.
    private void OnDataGridViewCellFormat(object sender, DataGridViewCellFormattingEventArgs e)
      {
      if (this.dataGridView.Columns[e.ColumnIndex].Name == "imgType")
        {
        Assembly a = Assembly.GetExecutingAssembly();
        // get a list of resource names from the manifest
        //string[] resNames = a.GetManifestResourceNames();

        int iRow = e.RowIndex;
        if (cdsMessageDataSet.Messages[iRow].msgtype == "E")
          {
          e.Value = Bitmap.FromStream(a.GetManifestResourceStream("cdsProCS.Resources.Work.bmp")) as Bitmap;
          }
        else
          {
          e.Value = Bitmap.FromStream(a.GetManifestResourceStream("cdsProCS.Resources.PhoneCall.bmp")) as Bitmap;
          }
        }
      }
I have also tried:
DataRowView dv = cdsMessageDataSet.Messages.DefaultView[iRow];
if (dv["msgtype"].ToString() == "E")
To no avail.

Once the DataGridView is sorted, both methods point to the wrong record.

So I'm back to one of my earlier questions...

How do I access the current record in the DataSet.DataTable for the current row of a DataGridView?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform