|
I have made a collapsible composite custom control that has two panels acting as Header and Body of the control. I dont know how to make its designer so that users of the control are able to drag and drop controls in its Header or Body. I can add/remove controls in them programmatically but I dont know how to make it work at design time.
I dont want to use Templates in my custom control. I want to use all the properties of Panel control and thats why I am using Panels as Header and Body of the control. But I want to make it behave like two editable regions at design time too.
Thank You
Regards
Khalid
|
|
|
|
|
|
I know that I would have to make a custom designer for my control. The problem I am getting is that I have not used ITemplate in my custom control and I just dont want to use it for some reason. Instead, I have used Panel controls in my Custom Control. So, in this situation how can I make my custom designer so that there are two editable regions over it that actually make Header and Body of the control and correspond to respective Header and Body Panels of the control.
Regards
Khalid
|
|
|
|
|
Hi...
How can i sort a datalist items? i mean sort a column in datalist.
thanks.
behnam davoodi
|
|
|
|
|
when click on the column name(datalist header) rebind the datalist with the updated resultset(orderby that column name).
Best Regards,
Apurva Kaushal
|
|
|
|
|
So I have a project in SourceSafe but there are no solution files.
Now im going around in circles creating new project and virtual directories etc but i can't get it to work, can i create the project without the project/solution files?
I will respond if any additional information is needed, need help ASAP if possible
Thanks in advance,
Colum
Ps Using Visual Studio 2003 and asp.net
|
|
|
|
|
You should be able to create an empty solution and add the existing projects to it.
The project itself usually doesn't contain any more information than references to DLLs and other projects. If all else fails, you could just create new projects and add the source files to it.
---
b { font-weight: normal; }
|
|
|
|
|
how to write DropDownList1_SelectedIndexChanged() method fro dropdownlist which is inside datagrid.
Pradeep Reddy
|
|
|
|
|
What you can do is put the name there in the html part of the dropdownlist(inside the datagrid) at "OnSelectedIndexChanged" and then define it in the code behind. Don't forget to make autopostback property to true.
BTW please use a better subject line.
Best Regards,
Apurva Kaushal
|
|
|
|
|
public void ddl3(object sender,System.EventArgs e)
{
calculate1();
}
iam using name ddl3 in inlinecode
public void calculate1()
{
TextBox tb1,tb2;
DropDownList dl1,dl2;
tb1=(TextBox)DataGrid1.FindControl("TextBox3");
tb2=(TextBox)DataGrid1.FindControl("TextBox4");
dl1=(DropDownList)DataGrid1.FindControl("DropDownList3");
dl2=(DropDownList)DataGrid1.FindControl("DropDownList4");
tb1.Text=dl2.SelectedValue;
int a=int.Parse(dl1.SelectedValue);
int b=int.Parse(dl2.SelectedValue);
int c=a/b;
tb2.Text=c.ToString();
}
this is giving error
Pradeep Reddy
|
|
|
|
|
What error?
Best Regards,
Apurva Kaushal
|
|
|
|
|
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Pradeep Reddy
|
|
|
|
|
you try accessing the dropdownlist like this in the event:
DropDownList list = (DropDownList)sender
and then use it.
Best Regards,
Apurva Kaushal
|
|
|
|
|
sir can u plz explain me little bit clearly this
Pradeep Reddy
|
|
|
|
|
Actually why you were getting the error because you were not been able to get the control and then was using it that why you getting that object reference.. error.
In you event just set the reference for the dropdownlist and check whether it works or not.
suppose this your method:
public void Test(object sender, System.EventArgs e)
{
DropDownList list = (DropDownList)sender;
string hh = list.SelectedItem.ToString(); //to get the selected string.
}
Best Regards,
Apurva Kaushal
|
|
|
|
|
thank u sir, i got it
Pradeep Reddy
|
|
|
|
|
always welcome..
BTW one more thing don't call me sir, apurva will be ok.
Best Regards,
Apurva Kaushal
|
|
|
|
|
public void aa(object sender,System.EventArgs e)
{
DropDownList dl=(DropDownList)sender;
ss=dl.SelectedValue.ToString();----->this is working fine
TextBox tb=(TextBox)DataGrid1.FindControl("TextBox1");
tb.Text=ss;------->this is giving error
}
-- modified at 1:13 Tuesday 12th September, 2006
Pradeep Reddy
|
|
|
|
|
You can't get the textbox(which is inside the datagrid) like this. You need to have the find the index and then to find the control.
Probably first get the datagrid item like this:
TableCell cell = list.Parent as TableCell;<br />
DataGridItem item = cell.Parent as DataGridItem;
then you try to find the textbox control in it.
Best Regards,
Apurva Kaushal
|
|
|
|
|
TextBox tb1,tb2;
DropDownList dl1,dl2;
dl1=(DropDownList)sender;
string ss=dl1.SelectedValue.ToString();
tb1=(TextBox)DataGrid1.Items[0](i was missing this).FindControl("TextBox3");
tb1.Text=ss;
thank u i got the solution
Pradeep Reddy
|
|
|
|
|
Best Regards,
Apurva Kaushal
|
|
|
|
|
If I am not wrong, you have added this drop down in the edit Item template of Datagrid. What you can do is, You can go to the HTML source code and where there you have added this Edit Item Template you can add an event for dropdown in the HTML code itself.
<asp:dropdownlist id="DropDownList1" onselectedindexchanged="DropDownList1_SelectedIndexChanged" runat="server">
Regards,
Amit Kumar
HDISM, PGDCA, MCP, MCAD, MCSD
amit_chikara2002@hotmail.com
|
|
|
|
|
yes your right i added dropdownlist in edit item template.
how to add event i dont know plz tyell me the syntax
Pradeep Reddy
|
|
|
|
|
How to invoke the event in java script for submit button even though the button was disabled.
Jey
|
|
|
|
|
You can't activate a button that is disabled. You have to enable it first.
If you just want to post the form, you can use the submit method on the form.
---
b { font-weight: normal; }
|
|
|
|