Click here to Skip to main content
15,559,819 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Spell Check. Pin
Dustin Metzgar20-Jul-06 9:06
Dustin Metzgar20-Jul-06 9:06 
QuestionHow to get silent post back field values Pin
Sayed Muhammad Imran20-Jul-06 1:06
Sayed Muhammad Imran20-Jul-06 1:06 
AnswerRe: How to get silent post back field values Pin
Paddy Boyd20-Jul-06 1:55
Paddy Boyd20-Jul-06 1:55 
GeneralRe: How to get silent post back field values Pin
Mohammed Amine20-Jul-06 3:45
Mohammed Amine20-Jul-06 3:45 
QuestionHow to calculate amount in datagrid. Pin
ypsyong20-Jul-06 0:47
ypsyong20-Jul-06 0:47 
AnswerRe: How to calculate amount in datagrid. Pin
_AK_20-Jul-06 0:53
_AK_20-Jul-06 0:53 
GeneralRe: How to calculate amount in datagrid. Pin
ypsyong20-Jul-06 1:03
ypsyong20-Jul-06 1:03 
GeneralRe: How to calculate amount in datagrid. Pin
_AK_20-Jul-06 1:17
_AK_20-Jul-06 1:17 
here is the sample code which will help you:

public void dg_OnItemDataBound(object sender, DataGridItemEventArgs e)<br />
		{<br />
			if(e.Item.ItemType==ListItemType.Item || e.Item.ItemType==ListItemType.AlternatingItem)<br />
			{<br />
				DataRow drv = e.Item.DataItem;<br />
				Label lbl = (Label)e.Item.FindControl("lblValue");<br />
				lbl.Text = drv["Quantity"].ToString() * drv["Unit Price"].ToString();<br />
				DropDownList dd = (DropDownList)e.Item.FindControl("ddl");<br />
				string str = "javascript:return ValFunc(" + dd.ClientID.ToString() + ");";<br />
				dd.Attributes.Add("onChange",str);<br />
<br />
<br />
			}<br />
		}


Here label control will be there in your datagrid as template column and will display the calculated value.
Also you have to take care about the casting.

Best Regards,
Apurva Kaushal
GeneralRe: How to calculate amount in datagrid. Pin
ypsyong20-Jul-06 1:26
ypsyong20-Jul-06 1:26 
GeneralRe: How to calculate amount in datagrid. Pin
_AK_20-Jul-06 1:30
_AK_20-Jul-06 1:30 
QuestionResxResourceWriter Pin
Spykraft19-Jul-06 23:53
Spykraft19-Jul-06 23:53 
AnswerRe: ResxResourceWriter Pin
minhpc_bk20-Jul-06 8:56
minhpc_bk20-Jul-06 8:56 
QuestionI have a problem with .net 2005 [modified] Pin
Nui doi19-Jul-06 23:26
Nui doi19-Jul-06 23:26 
AnswerRe: I have a problem with .net 2005 Pin
blurMember19-Jul-06 23:35
blurMember19-Jul-06 23:35 
AnswerRe: I have a problem with .net 2005 Pin
Paddy Boyd19-Jul-06 23:55
Paddy Boyd19-Jul-06 23:55 
AnswerRe: I have a problem with .net 2005 Pin
minhpc_bk20-Jul-06 0:49
minhpc_bk20-Jul-06 0:49 
GeneralRe: I have a problem with .net 2005 Pin
Nui doi20-Jul-06 17:15
Nui doi20-Jul-06 17:15 
GeneralRe: I have a problem with .net 2005 Pin
minhpc_bk20-Jul-06 17:39
minhpc_bk20-Jul-06 17:39 
QuestionLanguage Tool Pin
Nable19-Jul-06 23:14
Nable19-Jul-06 23:14 
AnswerRe: Language Tool Pin
Paddy Boyd19-Jul-06 23:58
Paddy Boyd19-Jul-06 23:58 
GeneralRe: Language Tool Pin
Nable20-Jul-06 0:55
Nable20-Jul-06 0:55 
GeneralRe: Language Tool Pin
Paddy Boyd20-Jul-06 1:02
Paddy Boyd20-Jul-06 1:02 
GeneralRe: Language Tool Pin
Nable20-Jul-06 19:37
Nable20-Jul-06 19:37 
QuestionCalendar Control is not working in Live Server Pin
kpsetty19-Jul-06 22:03
kpsetty19-Jul-06 22:03 
QuestionDataFormatString Pin
aaraaayen19-Jul-06 21:39
aaraaayen19-Jul-06 21:39 

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.