well its kindof half-assed and it doesnt' incorporate padding lol but nonetheless, it works like a charm:
Public Sub AutoSizeDataGridColumns(ByVal dgData As DataGrid, ByVal strMappingName As String, ByVal intPadding As Integer)
Dim ex1 As New Exception("DataGrid must be databound")...
i changed the invoicetable dim so it gives it a table name, however when i put the dginvoice.datamember = ds.tables(0).tostring(dginvoice) i get an error:
Invoice.vb(1452): 'Public Overrides Function ToString() As String' has no parameters and its return type cannot be indexed.
edit: nvm got...
i keep getting "Invalid tablename in the DataSet" error when i run the resize sub with this command:
'dim column
Dim ugs As DataColumn = New DataColumn("ugs")
Dim sku As DataColumn = New DataColumn("sku")
Dim brand As DataColumn = New DataColumn("brand")
Dim...
Thanks
well its for an invoice to display items on it, so I need to define fixed column widths every time and do not need to automatically resize every time something is added, ex: sku is 8 characters, so no need for it to be larger, but i also want larger columns such as the short description...
Ok here's the situation:
datatable is created dynamically, it is set to a datagrid later in the code, when the datagrid shows the data, all the columns have the same width. I've played around with datagridtablestyle and columnstyles and such and haven't found anything that works. Anybody have...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.