|
Hi, all,
I have a gridview table with some columns vertical orientated, but after export to excel, all the column headers are horizontal, how can I keep the same format as gridview?
Also set the header row height after exported to excel?
Thanks!
|
|
|
|
|
Hi, all,
I have a gridview with sorting header, after I export it to excel, the links are still there, how can I remove the sort link?
I search the internet, somebody suggest using the following codes in Export_Click method:
GridView1.AllowSorting = false;
GridView1.DataBind();
But after I use this, the generated excel file have no data at all, only some html codes line .... .
Can anybody help me? Thanks!
|
|
|
|
|
|
Dear Friends,
I have three dropdownlist controls. When the page loads, first dropdownlist is filled and the remaining two are empty. When I select some value in First dropdownlist then corresponding values to be populated in Second dropdownlist and same When I select some value in Second dropdownlist then corresponding values to be populated in Third dropdownlist. The problem is, Whatever I select in the First dropdownlist automatically the first item only getting selected. Even If I selected the 5th Item, then also the First Item only getting selected. Please solve my problem.
Thanks & Regards,
Dileep.
|
|
|
|
|
Here is a simple example concerning updating derop
down list based on selction in another drop down ...
<%@ Page Language="C#" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<script runat="server">
protected void Button1_Click(object sender, EventArgs e)
{
DropDownList1.Items.Clear();
String[] ds = {"hi RED","sup RED"};
String[] ds1 = { "hi BLUE", "sup BLUE" };
if (DropDownList2.SelectedValue == "RED")
{
DropDownList1.DataSource = ds;
DropDownList1.DataBind();
}
if (DropDownList2.SelectedValue == "BLUE")
{
DropDownList1.DataSource = ds1;
DropDownList1.DataBind();
}
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Untitled Page</title>
<style type="text/css">
#UpdatePanel1 { width:300px; height:100px; } </style>
</head>
<body>
<form id="form1" runat="server">
<div style="padding-top: 10px">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<fieldset>
<legend>UpdatePanel</legend>
<asp:DropDownList ID="DropDownList1" runat="server">
</asp:DropDownList>
<asp:DropDownList ID="DropDownList2" runat="server">
<asp:ListItem>RED</asp:ListItem>
<asp:ListItem>BLUE</asp:ListItem>
</asp:DropDownList>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
</fieldset>
</ContentTemplate>
</asp:UpdatePanel>
<br />
</div>
</div>
</form>
</body>
</html>
|
|
|
|
|
Your description doesn't tell me much about the cause of your problem. Could you post some code, so that we may be able to help you.
..Go Green..
|
|
|
|
|
Are you binding the dropdown in page_load event. If so is it within if(!Ispostback) ?
I think thats the problem you did not bind the dropdown within if(!Ispostback)
I think this may help u.............
|
|
|
|
|
Your problem could it be like sandympatil said! or maybe you're setting the same dropDownList1.DataValueField in the data source...
for example I have as source:
-column1----column2
---------------------
-red------------value1
-blue-----------value1
-orange-------value1
-black----------value1
and dropdownlist is
dropDownList1.DataTextField = "column1";
dropDownList1.DataValueField = "column2";
look out that. If that's so, the post back always select the first option with 'value1'... Ahh! I recommend you to use ajax CascaddingDropDownList Here!![^]
|
|
|
|
|
Hi guys, am trying to empty my datagrid before i bind new records(items)
I tried the following but they won't work:
myDataGrid.DataSource = null;
myDataGrid.DataBind();
or
myDataGrid.Dispose();
|
|
|
|
|
Even if you empty your grid it'll populate with the new records.then Why you want to empty datagrid before binding with new records?
|
|
|
|
|
From the example program in my reply
to cheguri ...
DropDownList1.Items.Clear();
|
|
|
|
|
Try this :
<br />
DataTable dt = new DataTable;<br />
myDataGrid.DataSource = dt;<br />
|
|
|
|
|
I have one web page with 4 RadioButtonList controls and some panels.
I want to view specific panel content depending on radio buttons.
For example,
RadioButtonList1 (RBL1) contains 3 radio buttons.
each radio button will show one another RadioButtonList Control.
And each radiobutton of other RadioButtonLists will show correcsponding panels.
I have done this one in normal code behind concept. When I add Update Panel control, it doesn't work in Google Chrome.
Please give me a help.
|
|
|
|
|
Hi Experts,
I have designed and coded all my report pages.As my data is more then 500 charactres in one of my fied, the entry directly goes to second page and the first page remains blank as i have a page header covering 1/4th space in my first page....
Thus i wanted to have data on first page also and continue the remaining data on second page....Is there any property that i m forgetting to assign ?
Please Help.
Sharing Of Knowledge Provides Solution....
|
|
|
|
|
Hi guys, i have a datagrid with a check box.
when user clicks 'Delete' button, then all the rows
where a checkbox is checked should be deleted.
here is what i have tried and suprisingly only the first selected row get
deleted and the rest are ignored
CheckBox delSel;
for (int i = 0; i < contacts.Items.Count; i++)
{
delSel = (CheckBox)contacts.Items[i].Cells[1].FindControl("delSelection");
if (delSel.Checked)
{
string contactId = contacts.Items[i].Cells[0].Text;
string delet = manager.DeleteContact(contactId);
}
}
Please help if you know how i can delete all checked rows(contacts)
Thanks,
Morg
|
|
|
|
|
It should delete all the selected rows.Try to debug it you will get to know the reason.There might b some problem in logic.
After deleting all the rows bind your grid with fresh data again.
|
|
|
|
|
Ya managed to fix it...really just logic wasted my 3hours.
I was calling a method to update my datagrid within the forloop,
to mean when it loops once i call the method to update datagrid
hence my selected/checked items get refreshed and lost.
So irritating
Anyway thanks for your help
|
|
|
|
|
it happens sometimes
|
|
|
|
|
DataGridDemo[^]
Look at the section Checkboxes and TextBoxes
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
hi,
currently i m working in asp.net 2.0 (2005).
1st time i m using the previousPage process.i tried to retrive a hidden variable (source page) value to my destination page.
1. i set the PostBackURl as my destination page on the button click on source page
2. i put the following coding in the destination onload event.
if ((PreviousPage != null) && (PreviousPage.IsCrossPagePostBack))
Label1.Text = System generated ID : " + Convert.ToString(PreviousPage.FindControl("HidTest"));
but always the PreviousPage is null and not coming inside the loop.
help me please - Karan
|
|
|
|
|
Hi,
you say PreviousPage is always null. When is the code you posted actually run? If it is on a postback,
PreviousPage is null, because there is no PreviousPage then. You should save the value
in a "If(!IsPostback)" part of your page load.
This is just a guess i'm afraid.
Good Luck
|
|
|
|
|
Hello friends,
I have created a report which uses CSS to set back-ground image a text box. When I run the report using ASP.NET CrystalReportViewer, the CSS formatting was applied but when I tried to print the report, the CSS formatting was not applied.
I am using Crystal Report for Visual Studio .NET 2005.
Please help me in solving this issue.
Shivanandan C V
|
|
|
|
|
hii........plz help
.... if i have one image...if i click on buton(i take as buton click event like btngreen_click) i need to change that total image to that green color..can u help me plz....
thanqu fnds...
~anisha~
|
|
|
|
|
Please don't post your question on several forums.
|
|
|
|
|
What kind of image is this, elaborate your question.
Shivanandan C V
|
|
|
|