|
Two options
1 - get your datasource to return data in five columns
2 - use a repeater to get more control over how your data is shown
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Use a datalist and Set the RepeatColumns property to 5
Create a template for the datalist with:
One imageControl binded to the image path
One optionally Hyperlink binded to an ID and with a format of something like: Page2.aspx?ID={0}
Alexei Rodriguez
|
|
|
|
|
m stuck up with the code for online quiz.. i would like to get the code for online quiz in asp.net and vb
|
|
|
|
|
|
use your brain n write the code yourself :P
|
|
|
|
|
Hi everyone,
I am using a master page in my asp.net website. I would like the web content to align in the center like facebook for example. I am using the header and footer in the master page. How can I do it?
Thank you.
|
|
|
|
|
In the masterpage you will find the tag. Just add after tag and before tag.
IE:
|
|
|
|
|
Thanks for responding. But I didn't see the code. Can you write it again?
|
|
|
|
|
funny.
It is:
<body>< center >
Your code here
< /center ></body>
|
|
|
|
|
Thank you. I will try it.
|
|
|
|
|
in the treeview , at runtime , i want to change the font color of the treenode , in javascript , how should i do it , it is working very fine , in the server side, but this leads to postback.
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
modified on Sunday, April 6, 2008 4:08 AM
|
|
|
|
|
You will need to handle the event in javascript and set the css for the element that paints the node.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Look at the page source and find out how tree-view is getting rendered. Get those elements using JS and set the style property.
|
|
|
|
|
Hi
I have a web user control that I create dynamically and then add it to a panel like this:
<br />
MatchingControl control = (MatchingControl)LoadControl("MatchingControl.ascx");<br />
Panel1.Controls.Add(control);
I can deal with the control with no problems before page post back, but when the page is posted back to the server (in response to a button) I can't get the control like this:
<br />
MatchingControl control = (MatchingControl) Panel1.Controls[0];
Any one knows how to do it?
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
The control is gone. You need to recreate it every postback, and you need to create it before page load if you want it to have viewstate.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hey guys
i have a drop down box in my page which contains list of countries
how can i programmatically select a certain item by it's value?
for example i lke to select USA by it's value US
here is a part of my drop down box code:
<asp:DropDownList ID="drpSettingsCountry" runat="server">
...
<asp:ListItem Value="UG">Uganda</asp:ListItem>
<asp:ListItem Value="UA">Ukraine</asp:ListItem>
<asp:ListItem Value="GB">United Kingdom</asp:ListItem>
<asp:ListItem Value="US">United States</asp:ListItem>
...
</asp:DropDownList>
thank you
|
|
|
|
|
drpSettingsCountry.SelectedValue = "US"
in your code behind.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
I have an existing custom control. I have added a new DropDownList control on it. I try to bind the data from to dropdownlist within an overriden CreateChildControls method thats been called on OnInIt event of custom control.
When I try to bind an datatable of <b>my typed data set</B>, it skips out of the CreateChildControls function at on line no. 4 of the following logic
1. director.DataAccess.PopulateDataSet();
2. ddlLocation = new DropDownList();
3. ddlLocation.ID = LocationID;
4. ddlLocation.DataSource = director.DataAccess.DataSet.WO_Location_List;
What might be the reason? Is some thing wrong with the dropdownlist control OR there is some issue with TypedDataset data for that dropdownlist?
Note: This databinding logic works absolutely fine with other dropdownlist controls on a different custom control
Regards,
Vipul Mehta
|
|
|
|
|
I think oninit is too early to databind to a control. Why are you doing it so early ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
I got this sorted out. Infact the DataType of one field in my select query & the datatable did not matched. As soon as I fixed it out it started working as expected.
Regards,
Vipul Mehta
|
|
|
|
|
Im converting Datatable to excel like this way
Response.Clear();
Response.ContentType = "application/vnd.ms-excel";
string sep = "";
foreach (object column in Columns)
{
string[] value = column.ToString().Split(',');
Response.Write(sep + value[0]);
sep = "\t";
}
Response.Write("\n");
foreach (DataRow dr in dt1.Rows)
{
sep = "";
for (i = 1; i < dt1.Columns.Count; i++)
{
Response.Write(sep + dr[i].ToString());
sep = "\t";
}
Response.Write("\n");
}
Response.End();
it converting fine but i would like to format the excel how's that possible. Thanks in advance byee
|
|
|
|
|
Make a comma the seperator, Excel will hopefully open as a CSV
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Create a CSSclass
and then add data with mso-number-format:....
in the css class.
More Info to be found here[^]
We style Date Fields with MSo-Number-Formatting via a static class
public static void styleDataTable(Table table)
{
foreach (TableRow row in table.Rows)
{
foreach (TableCell cell in row.Cells)
{
if (IsDate(cell.Text))
{
cell.CssClass = "tdDate";
cell.Width = Unit.Pixel(80);
}
}
}
}
In the DataTableToExcel Page we place in code behind:
Sesame.styleDataTable(htmlToExport);
(htmlToExport is a created Table based on the datatable)
|
|
|
|
|
thanks to both of you, i fixed the style by putting the data into html table and then wrote it in repose object, it was easy
thanks again
|
|
|
|
|
I have to send an email which should have company logo at top of the body and then some texts.
when i'm doing so at the receipent its not displaying any image at all
can anybody give me solution to this question asap......as its urgent
thanking u
Russel
|
|
|
|