Click here to Skip to main content
15,898,981 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
QuestionSetting up an installation wizard using dot net Pin
Annie Fernando4-Apr-06 23:33
Annie Fernando4-Apr-06 23:33 
AnswerRe: Setting up an installation wizard using dot net Pin
KreativeKai10-Apr-06 9:08
professionalKreativeKai10-Apr-06 9:08 
QuestionDeployment tool question Pin
Marc Clifton4-Apr-06 13:44
mvaMarc Clifton4-Apr-06 13:44 
QuestionResize GroupBox Pin
Dr. Pastor4-Apr-06 12:55
Dr. Pastor4-Apr-06 12:55 
AnswerRe: Resize GroupBox Pin
Robert Rohde4-Apr-06 18:17
Robert Rohde4-Apr-06 18:17 
GeneralRe: Resize GroupBox Pin
Dr. Pastor5-Apr-06 5:50
Dr. Pastor5-Apr-06 5:50 
QuestionLocalising .Net 2 Windows App Pin
Andrew Bleakley4-Apr-06 10:23
Andrew Bleakley4-Apr-06 10:23 
QuestionUsing a datagrid in a composite control Pin
gpartin4-Apr-06 7:48
gpartin4-Apr-06 7:48 
Hi,

I have a composite control that inherits from WebControl. The purpose of this control is to encapsulate a lengthy form that will be used throughout my application. The composite control renders as 10 textboxes and 2 datagrids. I build the datagrids dynamically:

private void LoadLicenseUsersDataGrid()
{
TemplateColumn firstNameColumn = new TemplateColumn();
firstNameColumn.ItemTemplate = new CreateItemTemplateTextBox("FirstName", "txtFirstName", false);
firstNameColumn.HeaderText = "First Name";

TemplateColumn lastNameColumn = new TemplateColumn();
lastNameColumn.ItemTemplate = new CreateItemTemplateTextBox("LastName", "txtLastName", false);
lastNameColumn.HeaderText = "Last Name";

TemplateColumn emailColumn = new TemplateColumn();
emailColumn.ItemTemplate = new CreateItemTemplateTextBox("Email", "txtEmail", false);
emailColumn.HeaderText = "Email";

BoundColumn BoundColumn = new BoundColumn();
BoundColumn.DataField = "ID";
BoundColumn.Visible = false;

this.dgLicenseUsers.Columns.Add(BoundColumn);
this.dgLicenseUsers.Columns.Add(firstNameColumn);
this.dgLicenseUsers.Columns.Add(lastNameColumn);
this.dgLicenseUsers.Columns.Add(emailColumn);

int intLicenseCount = 0;

DataTable dtLicenseUsers = this.objTechnicalQuestionairre.LicenseUserCollection.Copy();

dtLicenseUsers.PrimaryKey = null;
dtLicenseUsers.Columns["ID"].AllowDBNull = true;

DataRow drRow = null;

foreach(DataRow drAccessTypeRow in this.objTechnicalQuestionairre.AccessTypeCollection.Rows)
{
intLicenseCount += (int)drAccessTypeRow["NumberOfLicenses"];
dtLicenseUsers.Columns.Add(drAccessTypeRow["AccessCode"].ToString());

TemplateColumn accessColumn = new TemplateColumn();
accessColumn.ItemTemplate = new CreateItemTemplateCheckBox("chkAccess" + drAccessTypeRow["AccessCode"].ToString(), "", false);
accessColumn.HeaderText = drAccessTypeRow["AccessCode"].ToString();
this.dgLicenseUsers.Columns.Add(accessColumn);
}

int j = dtLicenseUsers.Rows.Count;

if (j < 10)
{
j = 10;

for (int i = 0; i < j; i++)
{
drRow = dtLicenseUsers.NewRow();
dtLicenseUsers.Rows.Add(drRow);
}
}
else
{
for (int i = 0; i < j % 10; i++)
{
drRow = dtLicenseUsers.NewRow();
dtLicenseUsers.Rows.Add(drRow);
}
}

this.dgLicenseUsers.DataSource = dtLicenseUsers;
this.dgLicenseUsers.DataBind();
}

Note: I prefill the datagrid with 10 blank rows that the user will be able to fill in.

The form renders perfectly but if I type text into the 3 columns of the datagrid, which are textboxes, and postback I am not sure how to capture the typed text. I call the above function in Render so I understand that each time the form renders the control is regenerated. So how do I only render the datagrid on PageLoad so that the typed text is available to me on each postback? Does my control have to implement IPostBackDataHandler?
AnswerRe: Using a datagrid in a composite control Pin
Ricardo Casquete4-Apr-06 22:28
Ricardo Casquete4-Apr-06 22:28 
Questionget running dll from another application Pin
bonannogionni4-Apr-06 6:35
bonannogionni4-Apr-06 6:35 
AnswerRe: get running dll from another application Pin
Kurt _B6-Apr-06 6:35
Kurt _B6-Apr-06 6:35 
QuestionVS 2003 and 2005 Pin
t4ure4n4-Apr-06 6:13
t4ure4n4-Apr-06 6:13 
AnswerRe: VS 2003 and 2005 Pin
CWIZO4-Apr-06 11:05
CWIZO4-Apr-06 11:05 
QuestionHelp! .net call the java interface Pin
hou1263-Apr-06 22:49
hou1263-Apr-06 22:49 
QuestionHeterogeneous .NET: IIS seamless login with LDAP Pin
ehuysamer3-Apr-06 4:57
ehuysamer3-Apr-06 4:57 
Questionhow we identify my hardware under linux Pin
ss20063-Apr-06 2:45
ss20063-Apr-06 2:45 
GeneralRe: how we identify my hardware under linux Pin
George L. Jackson3-Apr-06 2:53
George L. Jackson3-Apr-06 2:53 
Questioncompiling .net project distributedly Pin
samtam3-Apr-06 2:36
samtam3-Apr-06 2:36 
QuestionHow to retieve share point data from a windows application (c#) Pin
K ANvar sadath2-Apr-06 20:53
K ANvar sadath2-Apr-06 20:53 
QuestionConverting from C#.Net to Code for Mac Pin
Rabbit172-Apr-06 14:09
Rabbit172-Apr-06 14:09 
AnswerRe: Converting from C#.Net to Code for Mac Pin
Christian Graus2-Apr-06 14:15
protectorChristian Graus2-Apr-06 14:15 
QuestionHelp Needed Pin
Diplomat_Dave2-Apr-06 4:32
Diplomat_Dave2-Apr-06 4:32 
AnswerRe: Help Needed Pin
ehuysamer3-Apr-06 22:19
ehuysamer3-Apr-06 22:19 
QuestionDeploy .Net framework with applicaitons Pin
Maher Abu Zer1-Apr-06 18:48
professionalMaher Abu Zer1-Apr-06 18:48 
AnswerRe: Deploy .Net framework with applicaitons Pin
Braulio Dez2-Apr-06 7:32
Braulio Dez2-Apr-06 7:32 

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.