Click here to Skip to main content
15,887,683 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionRe: sql string connection Pin
AprNgp3-Oct-08 5:03
AprNgp3-Oct-08 5:03 
QuestionPagination in ASP Pin
Amit Battan Ror3-Oct-08 0:01
Amit Battan Ror3-Oct-08 0:01 
GeneralProduct Showcase Module Pin
Brady Kelly2-Oct-08 23:50
Brady Kelly2-Oct-08 23:50 
Questionexport image and datagrid in one pdf Pin
saravanan052-Oct-08 23:39
saravanan052-Oct-08 23:39 
QuestionDropDown Validation Problem Pin
Ajeet mittal2-Oct-08 22:02
Ajeet mittal2-Oct-08 22:02 
AnswerRe: DropDown Validation Problem Pin
J a a n s2-Oct-08 22:10
professionalJ a a n s2-Oct-08 22:10 
GeneralRe: DropDown Validation Problem Pin
Ajeet mittal2-Oct-08 22:18
Ajeet mittal2-Oct-08 22:18 
QuestionHow to add a blank item in DataList Control! [modified] Pin
Ross Brigoli2-Oct-08 21:49
Ross Brigoli2-Oct-08 21:49 
I have this friend asking me how to add a blank row in datalist control. I tried some stuff using a default item template (literal html &lttd&lt) and found out that it indeed does not display the newly inserted blank row. This is because the new inserted row with blank contents ("" or " ") will be translated to <td></td> in HTML which in most browser will not show anything even a place holder. To solve this, you have two options:

The first one is to modify the ItemTemplate to use a <asp:TextBox /> or <asp:Label /> instead of literal <td></td> control. You can do this by replacing the Item Template section under the <asp:DataList... with this one:

<ItemTemplate>
<asp:TextBox BorderColor="Gray"
BorderWidth="1" BorderStyle="Solid"
id="Text1" runat="server"
Text='<%# DataBinder.Eval(Container.DataItem, "Name") %>' />
<!-- <td><%# DataBinder.Eval(Container.DataItem, "Name") %></td> -->
</ItemTemplate>


Another option is that instead of adding a row that contains nothing, add a row in which at least one column contains a string with value "&nbsp". So that when the DataList control is translated to HTML the resulting translation will be <td>&nbsp</td> which will be visible in the browser. Try the code below:

private void addBlankRow()
{
DataTable dt = (DataTable)DataList1.DataSource;

DataRow dr = dt.NewRow();
dr["Name"] = "&nbsp";

dt.Rows.Add(dr);

dt.AcceptChanges();

DataList1.DataBind();
}


Good Luck!

-Ross Brigoli

modified on Friday, October 3, 2008 3:59 AM

Questionfile uploading problem Pin
Miss Maheshwari2-Oct-08 21:36
Miss Maheshwari2-Oct-08 21:36 
AnswerRe: file uploading problem Pin
Eduard Keilholz2-Oct-08 21:55
Eduard Keilholz2-Oct-08 21:55 
AnswerRe: file uploading problem Pin
J a a n s2-Oct-08 22:13
professionalJ a a n s2-Oct-08 22:13 
QuestionUnable to find the requested .Net Framework Data Provider. It may not be installed. Pin
Krazy Programmer2-Oct-08 21:36
Krazy Programmer2-Oct-08 21:36 
AnswerRe: Unable to find the requested .Net Framework Data Provider. It may not be installed. Pin
J a a n s2-Oct-08 22:06
professionalJ a a n s2-Oct-08 22:06 
AnswerRe: Unable to find the requested .Net Framework Data Provider. It may not be installed. Pin
N a v a n e e t h2-Oct-08 22:31
N a v a n e e t h2-Oct-08 22:31 
GeneralRe: Unable to find the requested .Net Framework Data Provider. It may not be installed. Pin
Krazy Programmer2-Oct-08 22:35
Krazy Programmer2-Oct-08 22:35 
QuestionPerformance Tuning Pin
Govind Bhanushali2-Oct-08 21:25
Govind Bhanushali2-Oct-08 21:25 
AnswerRe: Performance Tuning Pin
Eduard Keilholz2-Oct-08 21:56
Eduard Keilholz2-Oct-08 21:56 
AnswerRe: Performance Tuning Pin
Brij3-Oct-08 1:08
mentorBrij3-Oct-08 1:08 
QuestionHelp With Dynamic TextBox Pin
DotNetCoderJunior2-Oct-08 21:04
DotNetCoderJunior2-Oct-08 21:04 
AnswerRe: Help With Dynamic TextBox Pin
acroitoriu2-Oct-08 21:33
acroitoriu2-Oct-08 21:33 
GeneralRe: Help With Dynamic TextBox Pin
DotNetCoderJunior2-Oct-08 22:01
DotNetCoderJunior2-Oct-08 22:01 
GeneralRe: Help With Dynamic TextBox Pin
acroitoriu2-Oct-08 22:09
acroitoriu2-Oct-08 22:09 
GeneralRe: Help With Dynamic TextBox Pin
DotNetCoderJunior2-Oct-08 22:22
DotNetCoderJunior2-Oct-08 22:22 
GeneralRe: Help With Dynamic TextBox Pin
acroitoriu2-Oct-08 22:29
acroitoriu2-Oct-08 22:29 
GeneralRe: Help With Dynamic TextBox Pin
DotNetCoderJunior2-Oct-08 22:39
DotNetCoderJunior2-Oct-08 22:39 

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.