Click here to Skip to main content
10,500,000 members (63,077 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
i have a datalist and i use show many controls at itemcommand of data list
like this:

protected void DataList4_ItemCommand(object source, DataListCommandEventArgs e)
   {
 
       RadioButton rd5 = (RadioButton)e.Item.FindControl("RadioButton5");
}


Now My problem is I want to use Chart contol at itemCommend,

like this:
Chart1.DataSource = dt;
 
Chart1.DataBind();

And I am try this:
chart chart1 = (chart)e.Item.FindControl("chartshow");

it also not support at item commend,

so plz help me, how can i use chart control at itemcommend,

you also provide solution to me at gridView_RowCommand if possiable
Posted 3-Jan-13 0:03am
Edited 15-Jan-13 21:26pm
v6
Comments
Sheikh Muhammad Haris at 3-Jan-13 20:07pm
   
Seems interesting. Let me try :)
Sandeep Mewara at 7-Jan-13 8:51am
   
How is Chart control bind method related or close to gridview rowcommand?
Member 9731376 at 7-Jan-13 9:43am
   
K let me try also, from this i understand u hve an item and bind to chart.
for now u can use Datasource= tableBindingSource, and then use this with Series property of the chart.
Still let me try first :)
Arun1990 at 8-Jan-13 0:22am
   
i thing you not understand my problem,
my problem is i want to use chart control at rowcommand of gridview,

because i wand to bind chart control after click in a button which is in GridView
Suvabrata Roy at 8-Jan-13 1:07am
   
Hi Arun,

I think you need to show some chart on click of some specific button in DataGrid.

Then why you need chart chart1 = (chart)e.Item.FindControl("chartshow");

or you need populate Chart in between two rows.
Arun1990 at 8-Jan-13 2:15am
   
This is my problem:
chart chart1 = (chart)e.Item.FindControl("chartshow");

this is not support in gridview row command,
Try it,
Because i am able to write
RadioButton rd5 = (RadioButton)e.Item.FindControl("RadioButton5");

But Not This

chart1 = (chart)e.Item.FindControl("chartshow");

I thing Micro soft Not Provide this

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

I found The solution Its very easy:

just add namespace to top of page and you will get chart control at itemdatabound:

System.Web.UI.DataVisualization.Charting
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 448
1 OriginalGriff 275
2 Nakul Chaudhari 240
3 CHill60 185
4 CPallini 175
0 Sergey Alexandrovich Kryukov 10,277
1 OriginalGriff 8,805
2 Sascha Lefèvre 3,704
3 Maciej Los 3,392
4 Richard Deeming 2,500


Advertise | Privacy | Mobile
Web01 | 2.8.150520.1 | Last Updated 14 May 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100