Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Where is the property for Highlighting Grid:(
Message
De
20/05/2003 11:12:59
 
 
À
20/05/2003 06:57:51
Information générale
Forum:
ASP.NET
Catégorie:
WebForms
Divers
Thread ID:
00790338
Message ID:
00790510
Vues:
13
Mark,

I haven't used Grids, but I can answer the question anyway ... the code Cathi posted is an EventHandler. Click on your Grid, and then open the Property Sheet. One of the toolbar buttons at the top of the property sheet is for Events. Click on that button and you'll see your property list replaced with a list of events that can be handled for the grid. Find the MouseUp event and double-click on it. C# will create a delegate (which gets placed in the auto-generated code) to call the eventhandler. It will also create the MouseUp eventhandler at the bottom of your code. Just fill that in with the code that Cathi has provided.

~~Bonnie

>Sorry, I am very very new to C#
>
>where should this code go and how should it be called.
>
>
>
>>Hi Mark,
>>
>>Here is code to implement this:
>>
>>[C#]
>>
>>private void dataGrid1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
>>{
>>     System.Drawing.Point pt = new Point(e.X, e.Y);
>>     DataGrid.HitTestInfo hti = dataGrid1.HitTest(pt);
>>     if(hti.Type == DataGrid.HitTestType.Cell)
>>     {
>>          dataGrid1.CurrentCell = new DataGridCell(hti.Row, hti.Column);
>>          dataGrid1.Select(hti.Row);
>>     }
>>}
>>
>>
>>[VB/NET]
>>
>>Private Sub dataGrid1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles dataGrid1.MouseUp
>>     Dim pt = New Point(e.X, e.Y)
>>     Dim hti As DataGrid.HitTestInfo = dataGrid1.HitTest(pt)
>>     If hti.Type = DataGrid.HitTestType.Cell Then
>>          dataGrid1.CurrentCell = New DataGridCell(hti.Row, hti.Column)
>>          dataGrid1.Select(hti.Row)
>>     End If
>>End Sub
>>
>>
>>>I have just started to play with .net
>>>I dropped the base Grid class onto a form and exptected to be able to make it highlight the selected row but can not find a property to do this.
>>>Hopefully they have not missed this feature out because we had to wait years for it in VFP
>>>
>>>Thanks
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform