Click here to Skip to main content
15,896,154 members
Home / Discussions / C#
   

C#

 
GeneralRe: System.IO Copy() and Move() question Pin
Nick Parker11-Jul-03 4:10
protectorNick Parker11-Jul-03 4:10 
GeneralInsert a row into a DataGrid Pin
Kuan Tan10-Jul-03 9:07
Kuan Tan10-Jul-03 9:07 
GeneralRe: Insert a row into a DataGrid Pin
Not Active10-Jul-03 12:54
mentorNot Active10-Jul-03 12:54 
Generaldll question Pin
jrmcdona10-Jul-03 8:24
jrmcdona10-Jul-03 8:24 
GeneralRe: dll question Pin
Nick Parker10-Jul-03 8:39
protectorNick Parker10-Jul-03 8:39 
GeneralRe: dll question Pin
Heath Stewart10-Jul-03 9:00
protectorHeath Stewart10-Jul-03 9:00 
QuestionHow to Set Widths of Columns in a DataGrid, Anyone? Pin
Khang Nguyen10-Jul-03 6:17
Khang Nguyen10-Jul-03 6:17 
AnswerRe: How to Set Widths of Columns in a DataGrid, Anyone? Pin
Heath Stewart10-Jul-03 9:11
protectorHeath Stewart10-Jul-03 9:11 
Use DataGridTableStyles. You can easily do this during design-time with the DataGrid.TableStyles property. You can have multiple table styles, each bound to a different DataMember name (usually tables of a DataSet or something). Within each of these table styles, you specify each column and bind them to a DataColumn name (for each row of the table to which the style is bound). Programmatically, the same procedure is used. Lets say you want the last column of the first table style to be 100 pixels:
int count = dataGrid1.TableStyles[0].GridColumnStyles.Count;
dataGrid1.TableStyles[0].GridColumnStyles[count - 1].Width = 100;


This is for a System.Windows.Forms.DataGrid and can use other data sources other than a DataSet since table styles themselves don't have to bind to any data member and you can just specify the grid columns bound to certain columns / properties in whatever data source you use.

Now, if this is a System.Web.UI.WebControls.DataGrid, you have to use template styles.

In either case, try it in the visual designer, look at the code produced in the source file, and read the docs so you understand exactly what you're reading. It's not that hard and you can customize a lot without overriding anything.

 

Reminiscent of my younger years...
10 LOAD "SCISSORS"
20 RUN

GeneralRe: How to Set Widths of Columns in a DataGrid, Anyone? Pin
Khang Nguyen10-Jul-03 11:50
Khang Nguyen10-Jul-03 11:50 
GeneralExport Unmanaged DLL's classes instead of just function using PInvoke Pin
Anonymous10-Jul-03 5:40
Anonymous10-Jul-03 5:40 
GeneralRe: Export Unmanaged DLL's classes instead of just function using PInvoke Pin
leppie10-Jul-03 7:10
leppie10-Jul-03 7:10 
GeneralRe: Export Unmanaged DLL's classes instead of just function using PInvoke Pin
Anonymous10-Jul-03 7:36
Anonymous10-Jul-03 7:36 
GeneralRe: Export Unmanaged DLL's classes instead of just function using PInvoke Pin
leppie10-Jul-03 11:24
leppie10-Jul-03 11:24 
GeneralError Reading from MDB System Table Pin
SD310-Jul-03 5:17
SD310-Jul-03 5:17 
QuestionWhy DataSet Not Updated, Any Gurus? Pin
Khang Nguyen10-Jul-03 5:14
Khang Nguyen10-Jul-03 5:14 
AnswerRe: Why DataSet Not Updated, Any Gurus? Pin
Heath Stewart10-Jul-03 9:14
protectorHeath Stewart10-Jul-03 9:14 
GeneralRe: Why DataSet Not Updated, Any Gurus? Pin
Khang Nguyen10-Jul-03 11:54
Khang Nguyen10-Jul-03 11:54 
GeneralC#, Java and memory Pin
albean10-Jul-03 4:52
albean10-Jul-03 4:52 
GeneralRe: C#, Java and memory Pin
Ylis10-Jul-03 5:01
Ylis10-Jul-03 5:01 
GeneralRe: C#, Java and memory Pin
KingTermite11-Jul-03 7:44
KingTermite11-Jul-03 7:44 
Generalaccessing the key buffer Pin
Ylis10-Jul-03 4:51
Ylis10-Jul-03 4:51 
GeneralRe: accessing the key buffer Pin
Heath Stewart10-Jul-03 11:00
protectorHeath Stewart10-Jul-03 11:00 
GeneralRe: accessing the key buffer Pin
Ylis11-Jul-03 12:51
Ylis11-Jul-03 12:51 
GeneralWindows Application Startup Pin
bcox10-Jul-03 4:34
bcox10-Jul-03 4:34 
GeneralCombo Box Pin
totig10-Jul-03 4:23
totig10-Jul-03 4:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.