Click here to Skip to main content
15,890,897 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionusing Microsoft.Office.Interop.Word + timeout Pin
Member 769046020-Feb-11 18:37
Member 769046020-Feb-11 18:37 
Questionhtml to code behind Pin
Ramkumar_S20-Feb-11 15:38
Ramkumar_S20-Feb-11 15:38 
AnswerRe: html to code behind [modified] Pin
Andy_L_J20-Feb-11 15:50
Andy_L_J20-Feb-11 15:50 
GeneralRe: html to code behind Pin
Not Active21-Feb-11 4:23
mentorNot Active21-Feb-11 4:23 
AnswerRe: html to code behind Pin
Anurag Gandhi20-Feb-11 22:43
professionalAnurag Gandhi20-Feb-11 22:43 
QuestionHelp in understanding PopupControlExtender Pin
simsen19-Feb-11 0:10
simsen19-Feb-11 0:10 
QuestionRe: Help in understanding PopupControlExtender Pin
Sunasara Imdadhusen21-Feb-11 23:22
professionalSunasara Imdadhusen21-Feb-11 23:22 
QuestionFormat Dynamic GridView at runtime Pin
Andy_L_J18-Feb-11 23:22
Andy_L_J18-Feb-11 23:22 
I am new to Web development and am mucking around with creating controls on the fly and adding them to my page.

I create a GridView and bind it to a custom object.

Now how do I format the GridView as the rows are populated? For instance, set the column widths according to the cell contents?

Here is a code snippet:

 Dim dgv As GridView = New GridView

 dgv.ID = "dgv" & il.Div
 dgv.Width = 592
 dgv.DataSource = DTResults.GetShortResults(New Division(il.Id), s)
 dgv.DataBind()


 With dgv
    .ForeColor = Drawing.Color.FromArgb(51, 51, 51)
    .EnableModelValidation = True
    .GridLines = GridLines.None
    .CellPadding = 4
    .Font.Size = 10
    .Font.Name = "Arial"
    .HeaderStyle.BackColor = Drawing.Color.FromArgb(80, 124, 209)
    .HeaderStyle.Font.Bold = True
    .HeaderStyle.ForeColor = Drawing.Color.White
    .RowStyle.BackColor = Drawing.Color.FromArgb(239, 243, 251)
    .AlternatingRowStyle.BackColor = Drawing.Color.White
 End With

' add dgv to another control's Control collection
foo.Controls.Add(dgv)


I know how to do this using the OnRowDataBound attribute when creating a GridView at design time but here I am struggling.

Your suggestions are appreciared
I don't speak Idiot - please talk slowly and clearly

'This space for rent'

Driven to the arms of Heineken by the wife

Questionc#+object copy Pin
Ramkumar_S18-Feb-11 16:30
Ramkumar_S18-Feb-11 16:30 
AnswerCross Post Pin
dan!sh 19-Feb-11 0:05
professional dan!sh 19-Feb-11 0:05 
QuestionRunning a web application on two windows Pin
xyz_999@hotmail.com18-Feb-11 5:19
xyz_999@hotmail.com18-Feb-11 5:19 
AnswerRe: Running a web application on two windows Pin
Steve Maier18-Feb-11 5:50
professionalSteve Maier18-Feb-11 5:50 
QuestionAssign a Textbox in the parent page from a ModalPopup in asp.net Pin
Vimalsoft(Pty) Ltd17-Feb-11 23:40
professionalVimalsoft(Pty) Ltd17-Feb-11 23:40 
AnswerRe: Assign a Textbox in the parent page from a ModalPopup in asp.net Pin
Anurag Gandhi18-Feb-11 0:35
professionalAnurag Gandhi18-Feb-11 0:35 
GeneralRe: Assign a Textbox in the parent page from a ModalPopup in asp.net Pin
Vimalsoft(Pty) Ltd18-Feb-11 0:55
professionalVimalsoft(Pty) Ltd18-Feb-11 0:55 
GeneralRe: Assign a Textbox in the parent page from a ModalPopup in asp.net Pin
Anurag Gandhi18-Feb-11 1:18
professionalAnurag Gandhi18-Feb-11 1:18 
GeneralRe: Assign a Textbox in the parent page from a ModalPopup in asp.net Pin
Vimalsoft(Pty) Ltd18-Feb-11 1:29
professionalVimalsoft(Pty) Ltd18-Feb-11 1:29 
Questioncross query Pin
C#Coudou17-Feb-11 13:45
C#Coudou17-Feb-11 13:45 
AnswerRe: cross query Pin
GlobX17-Feb-11 14:45
GlobX17-Feb-11 14:45 
GeneralRe: cross query Pin
C#Coudou17-Feb-11 14:58
C#Coudou17-Feb-11 14:58 
GeneralRe: cross query Pin
GlobX17-Feb-11 15:08
GlobX17-Feb-11 15:08 
GeneralRe: cross query Pin
C#Coudou17-Feb-11 15:15
C#Coudou17-Feb-11 15:15 
GeneralRe: cross query Pin
thatraja17-Feb-11 15:28
professionalthatraja17-Feb-11 15:28 
AnswerRe: cross query Pin
Lisa Z. Morgan23-Feb-11 6:10
Lisa Z. Morgan23-Feb-11 6:10 
AnswerRe: cross query Pin
Anurag Gandhi17-Feb-11 22:13
professionalAnurag Gandhi17-Feb-11 22:13 

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.