| <telerik:AjaxSetting AjaxControlID="RadGrid1"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="RadGrid1" |
| LoadingPanelID="RadAjaxLoadingPanel1" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| <div id="ctl00_RadToolTipSiteMap" HideEvent="FromCode" style="display:none;"> |
| <div style="float: left; width: 80px; height: 24px; border-top: 1px solid #383838;text-align: left;"> |
| <span style="margin: 2px;"> |
| <asp:Image ID="ImageSiteMapIcon" runat="server" ImageUrl="~/gearth.gif" /></span> |
| <span id="sitemaplink" style="color: #fff; font: normal 12px Arial, sans-serif;">SiteMap</span></div> |
| <telerik:RadToolTip ID="RadToolTipSiteMap" runat="server" HideEvent="FromCode" TargetControlID="sitemaplink" IsClientID="true" RelativeTo="Element" Skin="Default" Position="BottomRight" OffsetX="-15" Animation="Resize" Height="350px" Width="500px" ShowEvent="OnMouseOver" ManualClose="true" > |
| <asp:UpdatePanel ID="upComments" runat="server"> |
| <ContentTemplate> |
| <cc1:GMap ID="Map2" runat="server" Height="350px" Width="500px" /> |
| </ContentTemplate> |
| </asp:UpdatePanel> |
| </telerik:RadToolTip> |
| <telerik:RadUpload |
| ID="UploadFile" runat="server" |
| Skin="Vista" |
| MaxFileInputsCount="5" |
| TargetFolder="~/ProfileImage" |
| OverwriteExistingFiles="false" InitialFileInputsCount ="1" /> |
| <asp:Button id="btnPreview" style="font-weight:bold;height:22px; width: 80px;" CssClass="btn" runat ="server" |
| Text ="Submit" OnClick="btnPreview_Click" CausesValidation ="false" /> |
| protected void btnPreview_Click(object sender, EventArgs e) |
| { |
| foreach (UploadedFile f in UploadFile.UploadedFiles) |
| { |
| string ffilepath = f.GetName(); |
| ObjuserModelCs.proc_insert_UpdateLoginImage(Convert.ToInt32(Session["WebsiteUserId"].ToString()), filepath); |
| previewField.ImageUrl = filepath; |
| } |
| } |
<
td ><telerik:RadComboBox ID="rcboNumAdultsFL" runat="server" Width="45px" BorderColor="#999999"></telerik:RadComboBox></td>
VB.NET code:
Private
Sub BindToNumberList(ByVal combo As RadComboBox)
Dim itemsList As String() = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"}
combo.DataSource = itemsList
combo.DataBind()
End Sub
Protected
Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If
Not Page.IsPostBack Then
BindToNumberList(
Me.rcboNumAdultsFL)
'Populate the datatable
Dim sConnString As String = ConfigurationManager.ConnectionStrings("PU89").ConnectionString
Dim objConnection As New SqlClient.SqlConnection(sConnString)
Dim strSQL As String = "SELECT * FROM tblRegistration WHERE ID='" & _ID & "';"
Dim dbComm As New SqlClient.SqlCommand(strSQL, objConnection)
Dim objDR As SqlClient.SqlDataReader
Try
objConnection.Open()
objDR = dbComm.ExecuteReader(System.Data.CommandBehavior.CloseConnection)
While objDR.Read()
With objDR
Me
.rcboNumAdultsFL.SelectedItem.Value = .Item("NumAdultsFL")
Me.rcboNumAdultsFL.SelectedItem.Text = .Item("NumAdultsFL")
End
With
End While
Catch ex As Exception
Response.Write(ex.Message)
Response.End()
Finally
If objConnection.State = ConnectionState.Open Then
objConnection.Close()
End If
End Try
End If
End Sub
This code results in the combo box showing the correct value from the db but it replaces the "0" in the array list. How do I get it to work properly?
Thanks,
Shelley
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Web.UI;
using my.Common;
using my.Common.Securities;
namespace my.Common.AjaxComponents
{
[DefaultProperty("Text")]
[ToolboxData("<{0}:myPanelBarMenu runat=server></{0}:myPanelBarMenu>")]
public class myPanelBarMenu : Telerik.Web.UI.RadPanelBar
{
private string panelDataTextField;
private string panelDataFieldID;
private string panelDataFieldParentID;
private string panelDataNavigateURL;
private int panelRowSecurityLevel;
private string panelAzManConnectionStringName;
private string panelAzManApplicationStringName;
private int panelRowText;
private int panelRowID;
private int panelRowParentID;
[Bindable(true)]
[Category("my")]
[DefaultValue("")]
[Localizable(true)]
[Description("Specifies the text that will display by the control")]
public string myDataTextField
{
get
{
return panelDataTextField;
}
set
{
panelDataTextField = value;
}
}
[Bindable(true)]
[Category("my")]
[DefaultValue("")]
[Localizable(true)]
[Description("Specifies the name of the Azman Application stored in web.config file section <appSettings> . If unspecfified key='myAzManServerCS'")]
public string myAzManConnectionStringName
{
get
{
return panelAzManConnectionStringName;
}
set
{
panelAzManConnectionStringName= value;
}
}
[Bindable(true)]
[Category("my")]
[DefaultValue("")]
[Localizable(true)]
[Description("Specifies the name of the Azman Application. This parameter is required")]
public string myAzManApplicationStringName
{
get
{
return panelAzManApplicationStringName;
}
set
{
panelAzManApplicationStringName= value;
}
}
[Bindable(true)]
[Category("my")]
[DefaultValue("")]
[Localizable(true)]
[Description("Specifies the column ID of the Row that contains SecurityLevel stored in Database")]
public int myRowSecurityLevel
{
get
{
return panelRowSecurityLevel;
}
set
{
panelRowSecurityLevel = value;
}
}
[Bindable(true)]
[Category("my")]
[DefaultValue("")]
[Localizable(true)]
[Description("Specifies the column ID of the Row that contains Text stored in Database")]
public int myRowText
{
get
{
return panelRowText;
}
set
{
panelRowText = value;
}
}
[Bindable(true)]
[Category("my")]
[DefaultValue("")]
[Localizable(true)]
[Description("Specifies the column ID of the Row that contains ID stored in Database")]
public int myRowID
{
get
{
return panelRowID;
}
set
{
panelRowID = value;
}
}
[Bindable(true)]
[Category("my")]
[DefaultValue("")]
[Localizable(true)]
[Description("Specifies the column ID of the Row that contains ParentID stored in Database")]
public int myRowParentID
{
get
{
return panelRowParentID;
}
set
{
panelRowParentID = value;
}
}
[Bindable(true)]
[Category("my")]
[DefaultValue("")]
[Localizable(true)]
[Description("Specifies the column ID of the Row that contains navigateURL stored in Database")]
public string myDataNavigateURL
{
get
{
return panelDataNavigateURL;
}
set
{
panelDataNavigateURL = value;
}
}
[Bindable(true)]
[Category("my")]
[DefaultValue("")]
[Localizable(true)]
[Description("Specifies the ID that will be used to populate root within hierachical PanelBar the control")]
public string myDataFieldID
{
get
{
return panelDataFieldID;
}
set
{
panelDataFieldID = value;
}
}
[Bindable(true)]
[Category("my")]
[DefaultValue("")]
[Localizable(true)]
[Description("Specifies the ParentID that will be used to populate all sub-level within hierachical PanelBar the control")]
public string myDataFieldParentID
{
get
{
return panelDataFieldParentID;
}
set
{
panelDataFieldParentID = value;
}
}
protected override void OnPreRender(EventArgs e)
{
base.RegisterScriptControl();
GetMenus _menu = new GetMenus();
DataTable dt = _menu.GetAllItemsMenus().Tables[0];
Security.AzManAuthenticationMethod Auth_method = new Security.AzManAuthenticationMethod();
Security.AzManAuthenticationMethod.AzManConnectionStringName = this.panelAzManConnectionStringName;
string _AzManConnection = Security.AzManAuthenticationMethod.GetAzManConnectionStringName();
string _AzManApplication = Security.AzManAuthenticationMethod.GetAzmanApplicationStringName();
try
{
Auth_method.LoadApp(_AzManConnection, _AzManApplication);
Auth_method.LoadCtx();
}
catch (System.Runtime.InteropServices.COMException x)
{
throw new Security.AzManAuthenticationMethod.AzMethodException(x, "IAzClientContext.AccessCheck");
}
SimpleMenu _myMenu = new SimpleMenu();
foreach (DataRow row in dt.Rows)
{
_myMenu.Add(new MenuItem(row[myRowSecurityLevel].ToString(), row[myRowText].ToString(), row[myRowID].ToString(), row[myRowParentID].ToString(),row[myDataNavigateURL].ToString()));
}
ArrayList al_GetAutorizedOperationsAZMAN = new ArrayList();
foreach (Security.AzManAuthenticationMethod.AccessCheckResult op_ok in Auth_method.AccessAll())
{
if (op_ok.result == 0)
{
al_GetAutorizedOperationsAZMAN.Add(op_ok.id.ToString());
}
}
DataSet aSet = new DataSet();
DataTable aTable = new DataTable();
aSet.Tables.Add(aTable);
aSet.Tables[0].Columns.Add("Text", typeof(String));
aSet.Tables[0].Columns.Add("Security_Level", typeof(String));
aSet.Tables[0].Columns.Add("ID", typeof(String));
aSet.Tables[0].Columns.Add("Parent_ID", typeof(String));
aSet.Tables[0].Columns.Add("Navigate_url", typeof(String));
if (_myMenu.Count != 0)
{
foreach (object co in al_GetAutorizedOperationsAZMAN)
{
if (_myMenu.Contains(co.ToString()))
{
DataRow aRow = aSet.Tables[0].NewRow();
aRow[0] = _myMenu[co.ToString()].Text;
aRow[1] = _myMenu[co.ToString()].Security_Level;
aRow[2] = _myMenu[co.ToString()].ID;
if (_myMenu[co.ToString()].Parent_ID == "")
{
_myMenu[co.ToString()].Parent_ID = null;
}
aRow[3] = _myMenu[co.ToString()].Parent_ID;
aRow[4] = _myMenu[co.ToString()].Navigate_url;
aSet.Tables[0].Rows.Add(aRow);
}
}
this.DataTextField = this.myDataTextField; ;
this.DataFieldID = this.myDataFieldID;
this.DataFieldParentID = this.myDataFieldParentID;
this.DataNavigateUrlField = this.myDataNavigateURL;
this.DataSource = aSet;
this.DataBind();
}
}
}
}
| //add a series for each person |
| for (int i = 0; i <= (selectedPersons.Count - 1); i++) |
| { |
| ChartSeries chartSeries = new ChartSeries(); |
| chartSeries.Name = selectedPersonNames[i].ToString(); |
| chartSeries.Type = ChartSeriesType.Line; |
| chartSeries.DataYColumn = "$"; |
| usageChart.Series.Add(chartSeries); |
| } |
| //set the x axis labels, adjust any appearance, and bind the data |
| usageChart.DataSource = personExpenses; |
| usageChart.PlotArea.XAxis.DataLabelsColumn = "Month"; |
| usageChart.DataBind(); |