|
Abijit, thanks, but when I add the (!page.ispostback) the dropdownlists no longer get dynamically created.
Brij, I can't initialize DropDownList1 and DropDownList2 in Page_init because they depend on a selection from DropDownList3 to populate the datasets? I get variable not valid errors when I try.
Like I said, I feel wretchedly dumb, but this is frustrating me.
|
|
|
|
|
Just Tell me what is your exact requirments?
cheers,
Abhijit
CodeProject MVP
Web Site:abhijitjana.net
When you ask a question, remember to click "Good Answer", If the Answer is helps you.
|
|
|
|
|
Dropdownlist3 has a list of studies (databases).
The user selects which one to use and then gets 2 lists (Dropdownlist1 and dropdownlist2) containing lists of definition files.
The user has to select a row file and a column file to populate a webgrid for statistical analysis. These selections are supposed to enable a button allowing the webgrid dataset creation.
I have the function to take the row selection and column selection and combine them into a dataset to create the webgrid, but if I cannot get the method to call that routine....
|
|
|
|
|
Then where Dynamic creation of Dropdown list comes into the picture, where as you have three specific dropdown list. if you dont want to show the third one you can make it Visiable=False , and show it when necessary. You need to create dynamic control when you donot need the specific number of control. As fer as I am seeing, There is no need of creation of dynamic control.
cheers,
Abhijit
CodeProject MVP
Web Site:abhijitjana.net
When you ask a question, remember to click "Good Answer", If the Answer is helps you.
|
|
|
|
|
As Abhijit says can you tell what is your actual requirement?
Cheers!!
Brij
|
|
|
|
|
I would say that the code which you've not posted, as far as I can see, is resetting the content of the other two lists, and thus killing the event.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Here is the code behind my page...
public partial class _Default : System.Web.UI.Page
{
public string study = "";
public string rowfile = "";
public string colfile = "";
public string path = "";
public string weight = "";
public TabEngineClass tab;
protected void Page_Load(object sender, EventArgs e)
{
if (this.Page.IsPostBack == false)
{
DataSet StudyList = new DataSet();
StudyList.ReadXml("C:\\WorkingFiles\\TestChartGrid\\TestChartGrid\\StudiesList.xml");
DropDownList3.DataSource = StudyList;
DropDownList3.DataValueField = "path";
DropDownList3.DataTextField = "cycle";
DropDownList3.DataBind();
}
}
protected void displayDefinitions(object sender, EventArgs e)
{
study = DropDownList3.SelectedItem.Text;
path = DropDownList3.SelectedItem.Value;
Label1.Visible = true;
Label2.Visible = true;
DropDownList1.Visible = true;
DropDownList2.Visible = true;
DataSet RowList = new DataSet();
RowList.ReadXml(path + ".xml");
DropDownList1.DataSource = RowList;
DropDownList1.DataValueField = "path";
DropDownList1.DataTextField = "file";
DropDownList1.DataBind();
DataSet ColumnList = new DataSet();
ColumnList.ReadXml(path + ".xml");
DropDownList2.DataSource = ColumnList;
DropDownList2.DataValueField = "path";
DropDownList2.DataTextField = "file";
DropDownList2.DataBind();
}
|
|
|
|
|
Forgot one routine...
protected void nextStep(object sender, EventArgs e)
{
if (rowfile != "")
{
if (colfile != "")
{
RadioButtonList1.Visible = true;
}
else
{
colfile = DropDownList2.SelectedItem.Value + DropDownList2.SelectedItem.Text;
}
}
else
{
rowfile = DropDownList1.SelectedItem.Value + DropDownList1.SelectedItem.Text;
}
}
|
|
|
|
|
Ignoring the sheer idiocy of your naming conventions, have you set breakpoints to step through all this code. Relying on paths to xml files like this for all your data seems very fragile to me.
I notice that that dropdownlist 1 and 2 both are set together, is there not an instance where you set the second list's value and want to update only the value in the third list ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
This is a throw-away app to show proof of concept to the upper echelon....
Yes, I have set breakpoints. Dropdownlist1 and 2 both need to have the same source (i.e. the same definition list from the database) because the user has to chose both a row source and a column source for the grid. So, no, there will never be a time that one will key off the other.
The issue I am encountering is that once the code from the displayDefinitions routine runs, none of my subsequent breakpoints gets hit. I can change the selection in DDL1 and DDL2 but it is not triggering the event to call the next Step routine.
|
|
|
|
|
Thanks all.
I found my solution. I had to go a different route to achieve the same effect.
|
|
|
|
|
hello friends i need your guidence as soon as possible i want to know how can we draw bar charts using asp.net while the data to bar chart graph is fed from a database
plz buddies help me....really need a way!!!!
|
|
|
|
|
you have several options .you can use microsoft chart controls or any third party chart controls like fusion chart etc.. for the same
Cheers!!
Brij
|
|
|
|
|
Which Framework of ASP.NET are you using? If it .NET 3.5 SP1 , you can go for, Microsoft Chart Control For It. Other wise you have some other option of well know Chart Tool like Dundas, Fusion, Nevron chart.
|
|
|
|
|
|
You can upgrade it easily to SP1 from internet and download ChartControls and can use it.
For samples Have a look
Cheers!!
Brij
|
|
|
|
|
can you suggest me code or tutorial.. that would be appreciated dear.. thanks in advance
|
|
|
|
|
solo_gaurav wrote: can you suggest me code or tutorial.. that would be appreciated dear.. thanks in advance
Sure,
You need to install .NET 3.5 SP1
ASP.NET Chart Control
You download the sample also from Microsoft Site
Hope this will helps you.
cheers,
Abhijit
CodeProject MVP
Web Site:abhijitjana.net
When you ask a question, remember to click "Good Answer", If the Answer is helps you.
|
|
|
|
|
i have downloaded the .net framework 3.5 sp1 and asp.net chart control...
installed
then ....
|
|
|
|
|
Now you can use the chart control .
See more details Here
Cheers!!
Brij
|
|
|
|
|
I have provided the sample in my above answer.
Cheers!!
Brij
|
|
|
|
|
not getting it correctly brij..but thanks anyways
|
|
|
|
|
Do you not able to go to the link?
URL is :http://code.msdn.microsoft.com/mschart
Cheers!!
Brij
|
|
|
|
|
thanks buddy... sounds good.. cheers
|
|
|
|
|
Your welcome
Cheers!!
Brij
|
|
|
|