Click here to Skip to main content
15,912,756 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionHow to get Open File Dialog on Button Click Event Pin
varshavmane22-Jun-06 21:26
varshavmane22-Jun-06 21:26 
AnswerRe: How to get Open File Dialog on Button Click Event [modified] Pin
Praveen_S23-Jun-06 3:27
Praveen_S23-Jun-06 3:27 
QuestionDropdownlist Tooltip Pin
jibcht22-Jun-06 21:21
jibcht22-Jun-06 21:21 
AnswerRe: Dropdownlist Tooltip [modified] Pin
_AK_22-Jun-06 21:24
_AK_22-Jun-06 21:24 
QuestionPlz help me? Pin
nabeelkhan22-Jun-06 20:20
nabeelkhan22-Jun-06 20:20 
AnswerRe: Plz help me? Pin
_AK_22-Jun-06 20:28
_AK_22-Jun-06 20:28 
GeneralRe: Plz help me? Pin
nabeelkhan22-Jun-06 21:00
nabeelkhan22-Jun-06 21:00 
GeneralRe: Plz help me? [modified] Pin
_AK_22-Jun-06 21:21
_AK_22-Jun-06 21:21 
Onitemdatabound is the event which fires for all the items of the datagrid. In that event first you need to find out the dropdownlist control and then attach the on change event to that.
Here os the code for the onitemdatabound event of the datagrid:

<code>public void test(object sender, DataGridItemEventArgs e)
{
if(e.Item.ItemType==ListItemType.Item || e.Item.ItemType==ListItemType.AlternatingItem)
{
DropDownList dd = (DropDownList)e.Item.FindControl("ddl");
string str = "javascript:return ValFunc(" + dd.ClientID.ToString() + ");";
dd.Attributes.Add("onChange",str);


}
}</code>

And here is the code which will be there in html section:

<code><asp:DataGrid id="DataGrid1" style="Z-INDEX: 101; LEFT: 248px; POSITION: absolute; TOP: 144px"
runat="server" Width="464px" Height="80px" OnItemDataBound="test">
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<asp:DropDownList ID="ddl" Runat="server">
<asp:ListItem>oooo</asp:ListItem>
<asp:ListItem>aaa</asp:ListItem>
<asp:ListItem>bbb</asp:ListItem>
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid></code>

And this is the javascript function for validation:

<code><script language=javascript>
function ValFunc(ss)
{

alert(ss.value);

return false;
}
</script></code>

Best Regards,
Apurva Kaushal

-- modified at 3:22 Friday 23rd June, 2006
GeneralRe: Plz help me? Pin
nabeelkhan22-Jun-06 21:47
nabeelkhan22-Jun-06 21:47 
GeneralRe: Plz help me? Pin
_AK_22-Jun-06 22:00
_AK_22-Jun-06 22:00 
QuestionWhere is .dll located in asp.net 2.0.............? Pin
Nagraj Naik22-Jun-06 19:24
Nagraj Naik22-Jun-06 19:24 
AnswerRe: Where is .dll located in asp.net 2.0.............? Pin
minhpc_bk22-Jun-06 22:58
minhpc_bk22-Jun-06 22:58 
GeneralRe: Where is .dll located in asp.net 2.0.............? Pin
Nagraj Naik23-Jun-06 1:22
Nagraj Naik23-Jun-06 1:22 
QuestionException while calling the macro of excel sheet from asp.net Pin
Sandeep Akhare22-Jun-06 19:23
Sandeep Akhare22-Jun-06 19:23 
AnswerRe: Exception while calling the macro of excel sheet from asp.net Pin
l0kke23-Jun-06 6:25
l0kke23-Jun-06 6:25 
Questionabout Html code generated by Aspx pages Pin
Irs_ahmad22-Jun-06 18:50
Irs_ahmad22-Jun-06 18:50 
AnswerRe: about Html code generated by Aspx pages Pin
Nagraj Naik22-Jun-06 19:50
Nagraj Naik22-Jun-06 19:50 
AnswerRe: about Html code generated by Aspx pages Pin
l0kke23-Jun-06 6:28
l0kke23-Jun-06 6:28 
QuestionHow to use AcroPDF.dll in Asp.Net (1.1)? Pin
sund7wells22-Jun-06 17:28
sund7wells22-Jun-06 17:28 
AnswerRe: How to use AcroPDF.dll in Asp.Net (1.1)? Pin
minhpc_bk22-Jun-06 23:29
minhpc_bk22-Jun-06 23:29 
QuestionSystem.DateTime to Short time Pin
Dhruvil22-Jun-06 11:29
Dhruvil22-Jun-06 11:29 
AnswerRe: System.DateTime to Short time Pin
minhpc_bk22-Jun-06 15:36
minhpc_bk22-Jun-06 15:36 
QuestionMaintain the Session using AJAX. Pin
YossiKahlon22-Jun-06 11:01
YossiKahlon22-Jun-06 11:01 
AnswerRe: Maintain the Session using AJAX. Pin
minhpc_bk22-Jun-06 15:38
minhpc_bk22-Jun-06 15:38 
GeneralRe: Maintain the Session using AJAX. Pin
YossiKahlon22-Jun-06 22:58
YossiKahlon22-Jun-06 22:58 

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.