Skip to content

Planet-Source-Code/mike-m-mitchell-set-datagrid-column-width__10-534

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation

Set Datagrid Column Width

Description

This is a simple example of how to dynamically set the column width in a DataGrid control. I spent hours trying to find something that seemed to me should have been a simple help example. I hope I can save somebody some time.

More Info

Submitted On
By Mike M. Mitchell
Level Beginner
User Rating 4.1 (58 globes from 14 users)
Compatibility VB.NET
Category Algorithims
World .Net (C#, VB.net)
Archive File

Source Code

Dim myGridTableStyle As DataGridTableStyle = New DataGridTableStyle()
    'Map the style to the dataset table. In this case I only use one table
    ' in my query.
    myGridTableStyle.MappingName = "Insured"
    grdQuotes.TableStyles.Add(myGridTableStyle)
    myGridTableStyle.GridColumnStyles(0).Width = 0
    myGridTableStyle.GridColumnStyles(1).Width = 250
    myGridTableStyle.GridColumnStyles(2).Width = 250

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published