myMenuItem.ImageUrl =
"~/Images/" & intTraderID & "/" & strImage
myMenuItem.HoveredImageUrl =
"~/Images/" & intTraderID & "/" & strRollover
myMenuItem.Text =
""
The menu has a custom skin applied before the items are added:
mnMenu.Skin = strMenuSkin
mnMenu.EnableEmbeddedSkins = bUseTelerik
Thi sall worked perfectly well until we upgraded to the latest release, but now the menu displays a margin around each image.
Using fiirebug, it looks to me like the css for the skin is being overridden by the default skin - is this correct? If so, is there a workaround? I have tried applying the page skin to each element as it is created, and also setting the skin after adding the items, but it makes no difference.
Is there something I have missed?
| function focusPicker(sender, args) { |
| sender.get_dateInput().focus(); |
| } |
| <telerik:RadAjaxPanel ID="upCal" runat="server"> |
| <telerik:RadCalendar ID="calShared" runat="server" EnableMultiSelect="false" /> |
| </telerik:RadAjaxPanel> |
| <telerik:RadDatePicker ID="calDischargeDate" runat="server" SharedCalendarID="calShared" ClientEvents-OnDateSelected="focusPicker" ValidationGroup="BasicClaimFields"/> |
| <telerik:GridButtonColumn CommandName="Complete_Select" ConfirmDialogType="RadWindow" |
| Text="Complete" UniqueName="completeSelect" CommandArgument="ID" AutoPostBackOnFilter="True" |
| ButtonType="PushButton" ButtonCssClass="btn" ItemStyle-Font-Bold="True"> |
| </telerik:GridButtonColumn> |
| <telerik:GridButtonColumn CommandName="Split_Select" ConfirmDialogType="RadWindow" |
| Text="Input to Appraisal" UniqueName="splitSelect" CommandArgument="ID" AutoPostBackOnFilter="True" |
| HeaderText="Appraisal Form" ButtonType="PushButton" ButtonCssClass="btn" ItemStyle-Font-Bold="True"> |
| </telerik:GridButtonColumn> |
Based on the "OnItemCommand" I run some codeBehind.
What I would like to do is make the PushButtons for that row disappear and replace them with text once the "completeSelect" has been pressed.
Any help would be appreciated.
I am building a list of questions with controls. One of the question returns with a radiobutton list, that when the user selects "other" a textbox will display for them to enter in additional information. I must be missing something, when I debug it looks like the textbox should work fine however the textbox never shows up... can somone help me to see what i am missing? My guess is that I somehow need to add this new textbox I am building to the AjaxManager ( if so can someone show me how to do this ? )...
I would have thought it would be ok as it is in the Placeholder that is already in the AjaxManager ?
here is the class:
public
partial class Tools_Workforce_OUT_PulseSurveyQuestions : EDCC.PageBase
{
private string _login = string.Empty;
private string _user = string.Empty;
private string _location = string.Empty;
private string _roll = string.Empty;
private string _sup = string.Empty;
string surveyType = "Video";
protected override void Page_Load(object sender, EventArgs e)
{
// Use to get user info from Active diretory
ActiveDirectoryBase ad = new ActiveDirectoryBase(User.Identity.Name.Split('\\')[1]);
base.lblMaster("PageName", "~/Tools/Workforce/OUT_PulseSurveyQuestions.aspx");
base.lblMaster("LastMod", "06/11/2009");
base.lblMaster("lblHeader", "Pulse Survey");
base.showMasterControl("pnlFooterLinks", base.m_CharterBase.GetSiteKey("ShowFooterLinks"));
base.showMasterControl("pnlUserInfo", "false");
base.showMasterControl("pnlMenu", "false");
(EDCC.User)Master.curUser = (EDCC.User)base.curUser();
// assign user info from Active diretory
_login = ad.DomainLogin;
_user = ad.DisplayName;
_location = ad.Location == string.Empty ? ad.Department : ad.Location;_roll = ad.Title;
_sup = ad.Supervisor.FullName;
Page.Header.Title = "Pulse Survey";
//surveyType = Request.QueryString["Type"];
lblPageTitle.Text = surveyType + " Pulse Survey ";if (!Page.IsPostBack)
{
GetPLSS_State();
//GetQuestions();
}
base.Page_Load(sender, e);
}
// questions & controls stay if there is a postback
protected override void OnInit(EventArgs e)
{
base.OnInit(e);GetQuestions();
}
#region DropDownsprivate void GetPLSS_State()
{
CharterBaseNew db = new CharterBaseNew("EDCCConnectString");
DataSet ds = db.ExecuteDataSet("PLSS_GetState", CommandType.StoredProcedure, CharterBaseNew.DbConnectionState.CloseOnExit);int i = ds.Tables.Count;
ddlState.DataSource = ds.Tables[0];
ddlState.DataTextField =
"State";
ddlState.DataValueField = "State";
ddlState.DataBind();
ddlState.Items.Insert(0, new RadComboBoxItem("** Pick A State **"));}
private void GetPLSS_City(){
CharterBaseNew db = new CharterBaseNew("EDCCConnectString");db.AddParameter(
"@State", ddlState.SelectedValue);
DataSet ds = db.ExecuteDataSet("PLSS_GetCity", CommandType.StoredProcedure, CharterBaseNew.DbConnectionState.CloseOnExit);int i = ds.Tables.Count;
ddlCity.DataSource = ds.Tables[0];
ddlCity.DataTextField =
"City";
ddlCity.DataValueField = "City";
ddlCity.DataBind();
ddlCity.Items.Insert(0, new RadComboBoxItem("** Pick A City **"));}
// show only cities in that state
protected void ddlState_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
{
lblCity.Visible = true;ddlCity.Visible = true;GetPLSS_City();
}
// to find out if other is selected, show textbox
protected void ddlCity_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
{
if (ddlCity.SelectedValue == "Other"){
txtOther.Visible = true;lblOther.Visible = true;}
else
{
txtOther.Visible = false;lblOther.Visible = false;}
}
#endregion
//BUILD THE CONTROLS FROM THE LIST OF QUESTIONS
public void GetQuestions()
{
foreach (PulseSurveyQuestions q in PulseSurveyQuestions.getQuestions(surveyType)){
string refType = q.RefListType;
// creates an HTML line break
HtmlGenericControl lineBreak = new HtmlGenericControl("br");
//builds questions
Label lblquestion = new Label();
lblquestion.ID =
"lblquestion" + surveyType + q.QuestionID;
lblquestion.Text = q.Question + "<br/>";
lblquestion.CssClass =
"LblName";
lblquestion.EnableViewState = true;
ph1.Controls.Add(lblquestion);
//builds Radiobutton list based on surveyType (ie: video, HSI, phone)
// and based on ControlType
if (q.ControlType == PulseSurveyQuestionTypes.RadioButtonList)
{
RadioButtonList rbl = new RadioButtonList();rbl.ID =
"rbl" + surveyType + q.QuestionID;
rbl.CssClass = "LblName";
rbl.Font.Size = 11;
rbl.DataSource = DataGateway.Instance.GetList(refType).Tables[0];rbl.DataTextField =
"DisplayText";
rbl.DataValueField = "ValueText";
rbl.DataBind();
rbl.AutoPostBack = true;rbl.EnableViewState = true;ph1.Controls.Add(rbl);
ph1.Controls.Add(lineBreak);
rbl.SelectedIndexChanged += new EventHandler(rbl_SelectedIndexChanged);}
//builds a textbox based on controlType
else if (q.ControlType == PulseSurveyQuestionTypes.TextBox)
{
TextBox txt = new TextBox();txt.ID =
"txt" + surveyType + q.QuestionID;
txt.CssClass = "LblName";
txt.Font.Size = 11;
txt.Width = 300;
txt.EnableViewState = true;ph1.Controls.Add(txt);
ph1.Controls.Add(lineBreak);
}
//builds a radiobutton list based on controlType (yes/no)
else if (q.ControlType == PulseSurveyQuestionTypes.YesNoRadio)
{
RadioButtonList rblYesNo = new RadioButtonList();rblYesNo.ID =
"rbl" + surveyType + q.QuestionID;
rblYesNo.CssClass = "LblName";
rblYesNo.DataSource =
DataGateway.Instance.GetList(refType).Tables[0];
rblYesNo.DataTextField = "DisplayText";rblYesNo.DataValueField = "ValueText";
rblYesNo.DataBind();
rblYesNo.EnableViewState = true;ph1.Controls.Add(rblYesNo);
ph1.Controls.Add(lineBreak);
}
//builds a dropdown based on controlType
else if (q.ControlType == PulseSurveyQuestionTypes.DropDown)
{
RadComboBox ddl = new RadComboBox();ddl.ID =
"ddl" + surveyType + q.QuestionID;
ddl.Skin = "WebBlue";
ddl.DataSource =
DataGateway.Instance.GetList(refType).Tables[0];
ddl.DataTextField = "DisplayText";ddl.DataValueField = "ValueText";
ddl.DataBind();
ddl.Items.Insert(0,
new RadComboBoxItem("** Box Type **"));
ddl.CssClass = "LblName";ddl.EnableViewState = true;
ph1.Controls.Add(ddl);
ph1.Controls.Add(lineBreak);
}
//builds a textbox with an add button based on controlType
// this is for account number
else if (q.ControlType == PulseSurveyQuestionTypes.TextBoxAddToList)
{
TextBox txtAdd = new TextBox();txtAdd.ID =
"txtAdd" + surveyType + q.QuestionID;
txtAdd.CssClass = "LblName";
txtAdd.Font.Size = 11;
txtAdd.EnableViewState = true;ph1.Controls.Add(txtAdd);
ph1.Controls.Add(lineBreak);
// add button to add another textbox
Button bt = new Button();
bt.ID =
"btAdd";
bt.Text = "Add another account";
ph1.Controls.Add(bt);
}
//builds a multiLine textbox based on controlType
else if (q.ControlType == PulseSurveyQuestionTypes.multiTextBox)
{
TextBox txtMulti = new TextBox();txtMulti.ID =
"txtMulti" + surveyType + q.QuestionID;
txtMulti.CssClass = "LblName";
txtMulti.Font.Size = 11;
txtMulti.TextMode = TextBoxMode.MultiLine;txtMulti.Width = 300;
txtMulti.Height = 100;
txtMulti.EnableViewState = true;ph1.Controls.Add(txtMulti);
ph1.Controls.Add(lineBreak);
}
}
}
// will build a textbox when "Other" or "Error code on Box") is selected
protected void rbl_SelectedIndexChanged(object sender, EventArgs e)
{
RadioButtonList rdbl = (RadioButtonList)sender;if (rdbl != null){
if (surveyType == "Video"){
if ((rdbl.Text == "Other") || (rdbl.Text == "Error code on Box")){
TextBox txtOther = new TextBox();
txtOther.ID = "txtRblOther";txtOther.CssClass = "LblName";
txtOther.Font.Size = 11;
ph1.Controls.Add(txtOther);
}
}
}
}
protected override void LoadViewState(object savedState){
base.LoadViewState(savedState);}
}
here is the front end :
<table>
<tr>
<td colspan="2" height="35px">
<asp:Label ID="Label1" runat="server" Text="What area are you receiving calls from in the last 10-15 mins?"
CssClass="LblName"></asp:Label>
</td>
</tr>
<tr >
<td valign="top">
<asp:Label ID="lblState" runat="server" Text="State" Width="25px" CssClass="LblName"></asp:Label>
</td>
<td>
<telerik:RadComboBox ID="ddlState" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlState_SelectedIndexChanged"
Skin="WebBlue">
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
<ExpandAnimation Type="OutQuart"></ExpandAnimation>
</telerik:RadComboBox>
<asp:Label ID="lblOther" runat="server" Text="Please enter in the missing city."
Style="z-index: 106; left: 190px; position: relative; top: -5px;" CssClass="LblName"
Font-Size="Small" Visible="False" ></asp:Label>
</td>
</tr>
<tr>
<td valign="top">
<asp:Label ID="lblCity" runat="server" Text="City" Width="25px" CssClass="LblName"
Visible="false"></asp:Label>
</td>
<td>
<telerik:RadComboBox ID="ddlCity" runat="server" Skin="WebBlue" Visible="False" OnSelectedIndexChanged="ddlCity_SelectedIndexChanged"
AutoPostBack="True"
ToolTip="Please select Other if you cannot find the city your looking for.">
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
<ExpandAnimation Type="OutQuart"></ExpandAnimation>
</telerik:RadComboBox>
<asp:TextBox ID="txtOther" runat="server" Visible="false" Style="z-index: 104; left: 190px;
position: relative; top: -20px;"></asp:TextBox>
</td>
</tr>
</table>
<br />
<asp:PlaceHolder id="ph1" runat="server"></asp:PlaceHolder>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="ddlState">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="ddlState" LoadingPanelID="RadAjaxLoadingPanel1" />
<telerik:AjaxUpdatedControl ControlID="lblCity" />
<telerik:AjaxUpdatedControl ControlID="ddlCity" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="ddlCity">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="lblOther" />
<telerik:AjaxUpdatedControl ControlID="txtOther"
LoadingPanelID="RadAjaxLoadingPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="ph1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="ph1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
</
asp:Content>
| <telerik:RadGrid ID="grdStudentResult" runat="server" Width="99%" |
| AllowMultiRowSelection="false" AllowMultiRowEdit="false" AllowPaging="true" |
| AutoGenerateColumns="False" ShowStatusBar="False" PageSize="20" |
| GridLines="None" AllowSorting="true" Skin="Gray" BorderStyle="None" OnSortCommand="grdStudentResult_GridSortCommand" |
| OnNeedDataSource="grdStudentResult_NeedDataSource" OnItemDataBound="grdStudentResult_ItemDataBound"> |
| <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="True" Position="TopAndBottom" |
| PagerTextFormat="Records {2} - {3} of {5} | Displaying page {0} of {1} | {4}" /> |
| <HeaderStyle BackColor="White" CssClass="label" Font-Bold="True" Font-Underline="True" ForeColor="#222C80" /> |
| <MasterTableView Width="100%" AutoGenerateColumns="False" DataKeyNames="StudentId" EditMode="InPlace" InsertItemDisplay="Bottom" |
| HeaderStyle-CssClass="label" BorderStyle="None" BackColor="White" HeaderStyle-ForeColor="#222C80" AlternatingItemStyle-BackColor="White" |
| HeaderStyle-Font-Size="11px" EditItemStyle-BackColor="#FFFF99" EditItemStyle-VerticalAlign="Middle" AllowCustomSorting="true" AllowNaturalSort="false" AllowSorting="true" |
| CommandItemSettings-RefreshImageUrl="../../../App_Themes/Default/images/spacer.gif" NoMasterRecordsText="No records found for the selected search criteria."> |
| <CommandItemSettings RefreshText="" /> |
| <RowIndicatorColumn> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </RowIndicatorColumn> |
| <ExpandCollapseColumn> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </ExpandCollapseColumn> |
| <Columns> |
| <telerik:GridTemplateColumn HeaderText="Student Name" UniqueName="StudentName" SortExpression="LastName" > |
| <ItemTemplate> |
| <asp:LinkButton |
| runat="server" |
| ID="lnkStudentName" |
| Text='' CSSClass="linkButton"> |
| </asp:LinkButton> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridTemplateColumn HeaderText="Student ID" UniqueName="StudentID" SortExpression="StudentId" > |
| <ItemTemplate><asp:Label runat="server" ID="lblStudentID" Text=''></asp:Label></ItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridTemplateColumn HeaderText="Email Address" UniqueName="EmailAddress" SortExpression="EmailAddress" > |
| <ItemTemplate> |
| <asp:HyperLink CSSClass="linkButton" |
| runat="server" |
| ID="lnkEmailAddress" |
| Text='<%# Eval("EmailAddress") %>' |
| NavigateUrl=''> |
| </asp:HyperLink> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridTemplateColumn HeaderText="Waiver Status" UniqueName="WaiverStatus" SortExpression="RecentWaiverResponseStatus" > |
| <ItemTemplate><asp:Label runat="server" ID="lblWaiverStatus" Text=''></asp:Label></ItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridTemplateColumn HeaderText="Waiver Name" UniqueName="WaiverName" SortExpression="RecentWaiverResponseName" > |
| <ItemTemplate> |
| <asp:HyperLink CSSClass="linkButton" |
| runat="server" |
| ID="lnkWaiverName" |
| Text='<%# Eval("RecentWaiverResponseFormattedName") %>' |
| NavigateUrl=''> |
| </asp:HyperLink> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridTemplateColumn HeaderText="Coverage Status" UniqueName="CoverageStatus" SortExpression="CoverageStatus" > |
| <ItemTemplate><asp:Label runat="server" ID="lblCoverageStatus" Text='<%# Eval("CoverageStatus") %>'></asp:Label></ItemTemplate> |
| </telerik:GridTemplateColumn> |
| </Columns> |
| </MasterTableView> |
| </telerik:RadGrid> |
| protected void grdStudentResult_NeedDataSource(object source, GridNeedDataSourceEventArgs e) |
| { |
| if (Page.IsPostBack) |
| { |
| presenter.SearchStudents(); |
| } |
| } |
| protected void grdStudentResult_GridSortCommand(object source, Telerik.Web.UI.GridSortCommandEventArgs e) |
| { |
| if (e.Item.ItemType != GridItemType.Header) |
| return; |
| SortOrder sortOrder = (SortOrder)Enum.Parse(typeof(SortOrder), e.NewSortOrder.ToString()); |
| e.Item.OwnerTableView.DataSource = presenter.SortResult(e.CommandArgument.ToString(), sortOrder); |
| e.Item.OwnerTableView.Rebind(); |
| } |
| protected void grdStudentResult_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) |
| { |
| } |
public class CustomEditor : GridTextColumnEditor |
| { |
| private TextBox textBox; |
| protected override void LoadControlsFromContainer() |
| { |
| this.textBox = this.ContainerControl.Controls[0] as TextBox; |
| } |
| public override bool IsInitialized |
| { |
| get |
| { |
| return this.textBox != null; |
| } |
| } |
| public override string Text |
| { |
| get |
| { |
| return "salmon"; |
| } |
| set |
| { |
| this.textBox.Text = value; |
| } |
| } |
| protected override void AddControlsToContainer() |
| { |
| this.textBox = new TextBox(); |
| this.ContainerControl.Controls.Add(this.textBox); |
| } |
| } |
Hi to all,
in my szenario i have a RadGrid with RadComboBoxes for every DataRow.
I have 12 DataRows and hide 10 of them, because of an Filter-Event by the user.
For the remaining 2 DataRows i change the values of the combo boxes on clientside.
Until here everything works.
But now i do a postback and would like to find the remaining 2 Datarow.
This does not work! Because i have no indicator.
The Indicator i needed i would like to set on clientside. The Indicator can be to set the datarow to selected or to check a checkbox in a GridTemplateColumn
| <telerik:GridTemplateColumn> |
| <ItemTemplate> |
| <asp:CheckBox ID="chkbSelected" runat="server" /> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
In this the JavaScript Code in which i try to set the Datarow to selected. But on the ParentObject this doesn´t work.
| //global DOM ID registry. filled up by scripts rendered from templates. |
| var registeredElements = []; |
| //looks for an element that has been registered with the global array |
| //requires that we emit a registration script block for each server control |
| function GetRegisteredServerElement(serverID) { |
| var clientID = ""; |
| for (var i = 0; i < registeredElements.length; i++) { |
| clientID = registeredElements[i]; |
| var combo = $find(clientID); |
| //Get the parent object, because this object has the visible attribute we need |
| var ParentObject = $find(combo.get_parent().get_id()); |
| //Check whether the value exists in the RadComboBox |
| var IsObject = combo.findItemByText(ColumnDecisonCombo.get_text()); |
| //declare a the dom elements to change the backgroundColor |
| var inputArea = combo.get_inputDomElement(); |
| //Only if the parent object is visible true and the RadComboBox contains the value |
| if (ParentObject.get_visible() && (IsObject != null)) { |
| /////HERE i NEED HELP |
| ParentObject.set_selected(); |
| combo.set_value(ColumnDecisonCombo.get_value()); |
| combo.set_text(ColumnDecisonCombo.get_text()); |
| inputArea.style.backgroundColor = "green" |
| } |
| else { |
| inputArea.style.backgroundColor = "red" |
| } |
| } |
| } |
Thanks