I am stuck in chart controls...Here is my prob... There is a ListBox containing some items...when user selects multiple items from the list box I want to generate a dynamic table with the number of columns same as that of the number items selected in the listbox. And for each selected item I want to show a seperate chart in the columns...Currently I want the same chart control for every selected item (i.e. a static hard coded chart that i will replace later by dynamic values)....I am using a method that draws a chart control using a sample dataset... I am calling it each time when a new column is created..Also the DrawChart method executes for the first column only and throws an index out of range exception! after the first execution...my code is not working...here
I am dynamically creating initial rows and cells in a asp:table on Page Load, whose cells need to have embedded user controls.
I have an Add Row button, where in, whenever I click I need to add rows to existing table and also persist viewstate of the user controls already added earlier to cells during initialization.
When I click on Add button, the controls disappear. how to recreate tables with their embedded user controls and populate the viewstate.
This is the basic piece of code I have currently and I am stuck -
I want to create columns in gridview dynamically based on rows in a table and each gridview colum should have a checkbox. When I Click the save button, I want to save the checkbox state. How Can I do this ?
I created a table dynamically with its row cell contain textbox. Now I need to show a hovermenuextender popup window on each rows textbox. I spend more time for this. But not getting till now.
This is my code for dynamically created table private void GenerateTable(int colsCount, int rowsCount) { string qry2 = "select lchannelname,ltransformdata from latestchannel where lenable=1"; DataTable dt = ob.getDetails(qry2); dt.Columns.Add(new DataColumn("combined", System.Type.GetType("System.String"), "lchannelname+ ' '+ltransformdata")); //Create the Table and Add it to the Page Table table = new Table(); table.ID = "Table1"; Page.Form.Controls.Add(table); int flag=0; foreach (DataRow dr in dt.Rows) { TableRow row = new TableRow(); row.Width = 200; TableCell cell = new TableCell(); TextBox tb = new TextBox(); tb.BorderColor = System.Drawing.Color.OliveDrab; cell.BorderColor = System.Drawing.Color.OliveDrab; cell.BorderWidth = 1; cell.Width = 200; tb.Width = 200; // tb.ReadOnly = true; tb.Text = dr["combined"].ToString(); tb.ID =flag.ToString(); cell.Controls.Add(tb); row.Cells.Add(cell); table.Rows.Add(row); AjaxControlToolkit.HoverMenuExtender hrv = new AjaxControlToolkit.HoverMenuExtender(); hrv.TargetControlID = tb.ID;
Here I am confusing for which way is using for popup panel1 hrv.PopupControlID = Panel1.ID; hrv.PopupPosition = AjaxControlToolkit.HoverMenuPopupPosition.Right; Panel1.Controls.Add(hrv); flag++; } } protected void Page_Load(object sender, EventArgs e) { int numOfColumns = 1; int numOfRows = ob.selectLatestEnableCount(); GenerateTable(numOfColumns, numOfRows); }
I want to popup this Panel1 on textbox through hovermenuextender <asp:Panel ID="Panel1" runat="server" Height="50px" Width="125px"> <div style="border:1px outset white;padding:2px;"> <div><asp:ImageButton ID="ImageButton1" ImageUrl="~/images/close.png" runat="server" /> <asp:LinkButton ID="lnkButtonHide" runat="server" CommandName="Edit" Text="Hide Channel" ForeColor="olivedrab" OnClick="lnkButtonHide_Click1" /> </div> <div> <asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="~/images/element_up.png" /> <asp:LinkButton ID="LinkButtonUp" runat="server" CommandName="Cancel" Text="Go Up One Pos" ForeColor="olivedrab" OnClick="LinkButtonUp_Click2"/> </div> <div> <asp:ImageButton ID="ImageButton3" runat="server" ImageUrl="~/images/element_down.png" /><asp:LinkButton ID="lnkButtonDown" runat="server" CommandName="Delete" Text="Go Down One Pos" ForeColor="olivedrab" OnClick="lnkButtonDown_Click1"/> </div> </div> </asp:Panel>
Using C# and SQL server. I need to dynamically format a web page which is intend for reporting. I have 2 SQL tables. Projects ( Project ID and Project Name) and Subprojects ( SubprojectName, ProectID, EmployeeName, Decription). Subprojects are linked to the projects throughthe ProjectID field
Needed format; Employee Name
All the project for that EmployeeName All the SubProjects for that EmployeeName undre the given project + Description of the subproject Eg: Peter Project A SubProject AA <subProject AA Description > SubProject AB <subProject AB Description > SubProject AC <subProject AC Description > Project B SubProject BA <subProject BA Description > SubProject BB <subProject BB Description ANN Project C SubProject CA <subProject CA Description > SubProject CB <subProject CB Description >
I have to show progress bar in datalist and having following scenario:
I am collecting response for the questions For each answer, total no of responses and their respective Percentage(%) is calculated
Now I have to show this % progress in progress bar
means if a answer have 100% response then progress bar show 100% (100% filled) if it have 50% response then only half of progress bar is filled (50% filled)and so on. response is calculated upto one decimal places(like it can be 33.3% or whatever)and respective % have to be shown in progress bar
So I have to create progress bar dynamically for each response %
How to display % in progress bar, I am using asp.net 2.0 with C#..
I have written some code to dynamically generate template columns for gridview which works well. However, each cell in the gridview has to be a linkbutton, which when clicked does a db update and redirects to a specific url with some parameters in it.
I have attached a click event handler to the linkbutton in the InstantiateIn method but the event does not seem to fire.
//Dynamically creating the Grid protected void btnAnalyze_Click(object sender, EventArgs e)
I am building a .net page and need to display some data residing in a database. Some of it's working, some not. I would like to use a table to display the data with the format below..
Table row - question data row - answer (count) row - next answer (count) row - BarChart representing the answer counts for question row - next question data row - answer (count) row - next answer (count) row - BarChart representing the answer counts for question
The question data and answer count rows are generated with no issue. However, the rows containing the barchart are problematic. Not sure how to create a new instance of a chart on the fly and hook in all the methods, etc. and get the control added to and displayed in the tablecell. Been looking for examples to create the chart on the fly with no real results.
I'm a bit of an ASP.NET newbie and I am creating a data table in memory and binding this to a gridview control. The code is as follows:
Dim DstBasket As New DataSet, TblBasket As New DataTable With TblBasket .Columns.Add("BskPrdCd", System.Type.GetType("System.String")) .Columns.Add("BskPrdDesc", System.Type.GetType("System.String")) .Columns.Add("BskQty", System.Type.GetType("System.Int16")) .LoadDataRow(Split("12345,Test product 1,1", ","), True) .LoadDataRow(Split("122,Test product 2,2", ","), True) .LoadDataRow(Split("123A,Test product 3,5", ","), True) .LoadDataRow(Split("44,Test product 4,1", ","), True) End With DstBasket.Tables.Add(TblBasket) With LfnGridView("GdvBasket") .DataSource = DstBasket .DataBind() End With
The data displays in the gridview control fine with both edit & delete options but when I attempt to delete, it has no effect. How do I force removal of the relevant row from both gridview and table? Most of the documentation I have unearthed shows how to achieve this when connected to a SQL table which is clearly not the case here.
I got GridView with 2 columns both are Template field with drop down list. What I need to do is someting like when user select course 3/3A/2A/2B , the type column will auto select pratical option dynamically. When select RTT /FTT/BTT , the type column will select Theory option. Can someone tell me how to work on this thing.
I have a form that's being databound with a SQLDataAdapter. I have a DropDownList with a SelectedValue='<%# Bind("FieldName")%>' on it. I was wondering if there was a way I could remove this field and set it dynamically in the codebehind and still have it insert the value of this field with the SQLDataAdapter. The reason for this is because the control I'm using doesn't have a separate InsertItemTemplate, only an EditItemTemplate which serves both purposes, and I need this to dropdownlist to only be databound on Insert.
Right now it's looking like I'll have to stop using the SQLDataAdapter and Update/Insert the data in the codebehind, but I wanted to see if there was something I was missing just-in-case.
I have a gridview which contains a templatefield. Inside this is an ImageButton and a dropdownlist. This is all created in the aspx page, although the ddl list items are populated in the RowDataBound event in the vb page. When i change the selected item in the drop down list and hit the imagebutton, the selected item is not maintained after postback. Instead the first record is displayed in the dropdownlist. I have wrapped an If Not Page.IsPostback around the datasource and databind's but this doesn't help. I have tried enabling viewstate in all areas on the page too, but still nothing. The list items for the ddl must be created on RowDataBound also. As far as I am aware, my ddl is not really dynamic, its just the list items which I add in the code behind which are classed as dynamic.
I'm dynamically adding a DropDownList to the GridView in edit mode and I have set the TextBox Visibility to False. In edit mode I can see the DropDownList and I'm able to select an Item from the DropDownList but not able to access the SelectedValue in RowUpdating Event. How to get the selectedvalue of this DropDownList?
Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound If e.Row.RowType = DataControlRowType.DataRow And (e.Row.RowState And DataControlRowState.Edit) > 0 Then Dim ddl as DropDownList FillStateList(ddl) e.Row.Cells(4).Controls.Add(ddl)
ddl is the DropDownList that is added dynamically. And the default Textbox that is in the Edit mode is set to invisible. So there are actually two controls in the same cell in edit mode(TextBox is invisible).
If I use the above statement I'm getting NullException.This is Probably because its a BoundField. Is there a way I can access the DropDownList 'ddl' SelectedValue?
I need to let my user add rows dynamically to a table, and after doing some research, it seems the best way to do this is through a GridView bound to a DataTable. However, I'm really struggling adding dropdownlists to the datatable, and this showing them in the gridview.
When the user opens the form, he or she will be presented with one row. ddl2 etc will be populated when ddl1 is selected etc etc. When appropriate, the textbox will be enabled allowing the user to enter a comment (this is to report errors, and since users are, at best, not to trust to write the same thing twice, I need to use ddls.
Now comes the question - how do I add a ddl to the datatable? I've tried several ways, but I cannot get them added.
i am working on Accounting software.in this software i am to implement voucher entries form.In this form on page load a table (two rows and four columns) should be created after that one row should be appended to that table dynamically on button click event.
I am having Gridview ie : inside i have placeholder, So on Gridview_RowDataBound - according the Specific Condition getting from DB then - i am Creating the Dropdownlist dynamically here and assign Datasource. so up to this its ok. My Problem When the user Select any value on the Dropdownlist on Gridview ,
i have one button outside the Gridview so if i click the button i am want to get the dropdownlist selectedValue so on the Button_Click Event
i used foreach row in the Gridview.. but i do no how to get the value. as the Dropdownlist is create dynamically on Gridview_RowDatabound event. but here what i have to write to get the dropdownlist?
I have Gridview and Button Control on Form.i want to Add Dynamically TextBox And DropDownList In Gridview on Button Click Wich is placed outside of Gridview.
When i click on Button -> One TextBox and One Dropdownlist which contains values bydefault 1,2,3 should bind to gridview. Button is placed outside Gridview.