Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Am I doing the resource access wrong
Message
De
19/07/2007 15:40:32
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
19/07/2007 15:03:19
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01241787
Message ID:
01242115
Vues:
19
>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?
DataGridViewCell cell = myDataGridView["myColumnToCheck", e.RowIndex];
DataGridViewRow row = myDataGridView.Rows[e.RowIndex];
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform