Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
148 views
How do I collapse the ribbonbar. In Windows I normally double click on any tab within the Ribbon. Thanks
Bozhidar
Telerik team
 answered on 02 Feb 2015
3 answers
960 views
Hi,

 I have bind the data in the grid from the

rgStaffPhysicianDetails.DataSource = GetPhysicianDetail();

in the server side code. So please give me the details of how the apply the filtering with the use selected filter criteria and value get from the filter textbox in the radgrid control.

protected void RadGrid1_PreRender(object sender, System.EventArgs e)
{
 
if (!Page.IsPostBack)
 {
   RadGrid1.MasterTableView.FilterExpression =
"([Country] LIKE \'%Germany%\') ";
   GridColumn column = RadGrid1.MasterTableView.GetColumnSafe(
"Country");
   column.CurrentFilterFunction = GridKnownFunction.Contains;
   column.CurrentFilterValue =
"Germany";
   RadGrid1.MasterTableView.Rebind();
 }
}

Here in this code filteration is server side but selection criteria is fixed,
 
so i need to set the selection criteria with use of the radgrid control selection criteria( like contains, not contains, NotFilter, StartWith, EndWith etc. ) any of the filter dropdownlist and filter value from the filter textbox in the radgrid control.

 So, i have problem how to get the selected value from the filter dowpdownlist and filtered value from the filter Textbox of radgrid control, Kindly help me as soon as possible.
 


Thanks
Pankaj Tyagi
Angel Petrov
Telerik team
 answered on 02 Feb 2015
1 answer
131 views
Hi,
is there a way to change ForeColor property (serverSide)?

MySearchBox.ForeColor = myCol;   doesn't works

Thanks
Dimitar Terziev
Telerik team
 answered on 02 Feb 2015
1 answer
274 views
Hi,

I am using Radupload control to upload files. After successful upload of file if page is refreshed then uploaded file is getting re upload. Please provide a solution. I can not use response.redirect() after first time upload.

Thank you.
Genady Sergeev
Telerik team
 answered on 02 Feb 2015
1 answer
68 views
Hi, 

I have a RadComboBox with Load on Demand activated and data is databound when OnItemsRequested event is fired.
  <telerik:RadComboBox ID="cmbVisualizationTemplates" runat="server"
    EnableLoadOnDemand="true"
    EmptyMessage="Select a template"
    Filter="Contains"
    AllowCustomText="false"
    DataTextField="NAME"
    DataValueField="ID_VISUALIZATION_TEMPLATE"
    OnClientItemsRequesting="selectedTemplatesRequesting"
    OnClientSelectedIndexChanged="selectedTemplateChanged"
    OnItemsRequested="cmbVisualizationTemplates_ItemsRequested"
    Style="width: 135px;">
</telerik:RadComboBox>


How can I show a message "No records found" when no items are returned to ComboBox?

Thanks for your help!

Alfonso
Dimitar Terziev
Telerik team
 answered on 02 Feb 2015
8 answers
647 views
hii,,
How to open radasyncupload window onclick of a radbutton??
thnks
Plamen
Telerik team
 answered on 02 Feb 2015
1 answer
387 views
I am trying to create a prototype for online quiz but stuck , can someone help?
My requirement is to create a quiz which will
1) Add the questions / answers dynamically as steps
2) validate the answers and if it is wrong answer add the question back again in the step so that they can retry

And also

I did achieve most of it except that my data and steps are getting mixed, I am sure there is a better way to do it , please help

And also why RadWizard1_WizardStepCreated called everytime there is a change in step

  protected void RadButton1_Click(object sender, EventArgs e)
        {
            //if (RadNumericTextBox1.Value > 0)
            //{
            RadButton button = (RadButton)sender;
            button.Enabled = false;
            List<data> data = new List<data>();
            data = (List<data>)HttpContext.Current.Session["data"];
            for (int i = 0; i < data.Count; i++)
            {
                RadWizardStep step = new RadWizardStep();
                step.ID = "Question"+(i + 1).ToString();                              
                RadWizard1.WizardSteps.Add(step);
            }
            RadWizardStep completeStep = new RadWizardStep();
            completeStep.ID = "Complete";
            RadWizard1.WizardSteps.Add(completeStep);
            RadWizard1.ActiveStepIndex = RadWizard1.WizardSteps[1].Index;
            //}
        }
  protected void RadWizard1_WizardStepCreated(object sender, Telerik.Web.UI.WizardStepCreatedEventArgs e)
        {
            if (e.RadWizardStep.ID == "Complete")
            {
               //complete logic
            }
            else
            {
                List<Data> data = new List<Data>();
                data = (List<Data>)HttpContext.Current.Session["data"];
                Label label = new Label();
                RadioButtonList list = new RadioButtonList();
                list.AutoPostBack = true;
                list.CausesValidation = true;
                list.SelectedIndexChanged += new EventHandler(list_SelectedIndexChanged);
              
                label.Text = data[e.RadWizardStep.Index - 1].Question;                     
                list.Items.Add(data[e.RadWizardStep.Index - 1].A);
                list.Items.Add(data[e.RadWizardStep.Index - 1].B);
                list.Items.Add(data[e.RadWizardStep.Index - 1].C);
              
                e.RadWizardStep.Controls.Add(label);
                e.RadWizardStep.Controls.Add(new Literal() { Text = "<br />" });
                e.RadWizardStep.Controls.Add(list);
                }
                  
                }          
           
        }
  private void list_SelectedIndexChanged(object sender, EventArgs e)
        {
            RadioButtonList RBL = (RadioButtonList)sender;
            List<data> data = new List<data>();
            data wrongAnswer = new data();
            data = (List<data>)HttpContext.Current.Session["data"];
            string s = RBL.SelectedValue.ToString();
            string y =  data[RadWizard1.ActiveStepIndex-1].Answer;
            if(s.Trim() == y.Trim())
            {
               some logic
            }
            else
            {
                some logic  


List<data> ldata= new List<data>();
data.Add(listQuizData[RadWizard1.ActiveStepIndex - 1]);
HttpContext.Current.Session["data"] = ldata; 
         
RadWizardStep step = new RadWizardStep();
step.ID = " Repeat Question";
RadWizard1.WizardSteps.Add(step);
            }
          
          
         
        }
Boyan Dimitrov
Telerik team
 answered on 01 Feb 2015
6 answers
156 views
im trying to update a radlistview control from an treenodepopulate event. when I click on the tree the event handler fires and tree node is expanded but the radlistview display is not updated and i'm trying to figure out why. I have create a single simple file that shows the issue i'm having. thanks

​
<%@ Page Language="C#" %>
<%@ Import Namespace="System.Data" %>
 
<!DOCTYPE html>
 
<script runat="server">
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack) {
            PopulateTopNodes();
        }
    }
 
    private void PopulateTopNodes()
    {
        DataTable dt = new DataTable();
        dt.Columns.Add("id");
        dt.Columns.Add("parent");
        dt.Columns.Add("value");
        dt.Columns.Add("haschild");
 
        dt.Rows.Add(new object[] { 1, "C:", "Documents", "Yes" });
        dt.Rows.Add(new object[] { 2, "D:", "Files", "No" });
 
        foreach (DataRow row in dt.Rows)
        {
            string parent = row["value"].ToString();
            TreeNode newNode = new TreeNode(row["value"].ToString(), parent);
            newNode.PopulateOnDemand = true;
            newNode.Expanded = false;
            newNode.SelectAction = TreeNodeSelectAction.Expand;
            TreeView1.Nodes.Add(newNode);
        }
    }
 
 
    protected void TreeView1_TreeNodePopulate(object sender, TreeNodeEventArgs e)
    {
        if (e.Node.NavigateUrl == "")
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("id");
            dt.Columns.Add("parent");
            dt.Columns.Add("value");
            dt.Columns.Add("haschild");
 
            dt.Rows.Add(new object[] { 1, "Documents", "Music", "Yes" });
            dt.Rows.Add(new object[] { 2, "Files", "Folder", "No" });
 
            foreach (DataRow row in dt.Rows)
            {
 
                string parent = row["parent"].ToString() + @"\" + row["value"].ToString();
                TreeNode newNode = new TreeNode(row["value"].ToString(), parent);
                newNode.SelectAction = TreeNodeSelectAction.Select;
                newNode.Expand();
                newNode.NavigateUrl = "page2.aspx";
                newNode.Expanded = true;
                e.Node.ChildNodes.Add(newNode);
            }
 
            //Populate the RadListView
            DataTable dt2 = new DataTable();
            dt2.Columns.Add("file");
            dt2.Columns.Add("size");
            dt2.Rows.Add(new object[] { "file1.txt", "4kb" });
            dt2.Rows.Add(new object[] { "anotherfile.log", "3mb" });
            this.RadListView1.DataSource = dt2;
            this.RadListView1.Rebind();
        }
    }
</script>
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
     
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnableTheming="True">
    </telerik:RadScriptManager>
 
    <telerik:RadSplitter runat="server" ID="RadSplitter1" Orientation="Vertical" Width="100%" BorderWidth="0" BorderColor="White" Height="760px" BorderSize="0">
         <telerik:RadPane runat="server" ID="MidPane" Scrolling="None" Width="49%" >
              <telerik:RadTabStrip ID="RadTabStrip1" ShowBaseLine="True" runat="server" MultiPageID="RadMultiPage1" SelectedIndex="0">
                  <Tabs>
                      <telerik:RadTab runat="server" Text="Directory Tree" PageViewID="PageView1" Font-Bold="true" ScrollChildren="true" Selected="True">
                      </telerik:RadTab>
                  </Tabs>
              </telerik:RadTabStrip>
              <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0"  Width="99%">
          
                 <telerik:RadPageView ID="PageView1" runat="server" width="100%" height="660px">                     
         
                        <asp:TreeView ID="TreeView1" runat="server" OnTreeNodePopulate="TreeView1_TreeNodePopulate"
                            ImageSet="XPFileExplorer" NodeIndent="15" ShowLines="false">
                            <ParentNodeStyle Font-Bold="False" />
                            <HoverNodeStyle Font-Underline="False" ForeColor="Black" />
                            <SelectedNodeStyle Font-Underline="False" Font-Names="Tahoma" Font-Size="8pt" ForeColor="Black"
                                HorizontalPadding="2px" NodeSpacing="0px" VerticalPadding="2px" />
                            <NodeStyle Font-Names="Tahoma" Font-Size="8pt" ForeColor="Black" HorizontalPadding="2px"
                                NodeSpacing="0px" VerticalPadding="2px" />
                        </asp:TreeView>
                     
                 </telerik:RadPageView>
                </telerik:RadMultiPage>
 
        </telerik:RadPane>
 
        <telerik:RadPane runat="server" ID="RadPane1" Scrolling="None" Width="49%">
                 
              <telerik:RadTabStrip ID="RadTabStrip2" ShowBaseLine="True" runat="server" MultiPageID="RadMultiPage1" Skin="Office2007" SelectedIndex="0">
                  <Tabs>
                      <telerik:RadTab runat="server" Text="Details" PageViewID="PageView1" Font-Bold="true" ScrollChildren="true" Selected="True">
                      </telerik:RadTab>
                  </Tabs>
              </telerik:RadTabStrip>
 
              <telerik:RadMultiPage ID="RadMultiPage2" runat="server" SelectedIndex="0"  Width="99%">
                 <telerik:RadPageView ID="RadPageView1" runat="server" width="100%" height="660px">
                         
                     <telerik:RadListView ID="RadListView1" runat="server" AllowPaging="false" ItemPlaceholderID="itemPlaceholder">
                         <LayoutTemplate>
                            <table style="width: 730px; background-color: #D9DFDF;">
                                <tr>
                                    <th id="Th1" runat="server">
                                        Name
                                    </th>
                                    <th id="Th2" runat="server">
                                        Size
                                    </th>
                                </tr>
                                <tr runat="server" id="itemPlaceholder" />
                            </table>
                        </LayoutTemplate>
                        <EmptyDataTemplate>
                            No files in this folder.
                        </EmptyDataTemplate>
                        <ItemTemplate>
                            <tr id="Tr2" runat="server" >
                                <td>
                                    <asp:Label ID="Name" runat="Server" Text='<%#Eval("file") %>' />
                                </td>
                                <td>
                                    <asp:Label ID="Size" runat="Server" Text='<%#Eval("size") %>' />
                                </td>
                            </tr>
                        </ItemTemplate>
                    </telerik:RadListView>
                 </telerik:RadPageView>
                </telerik:RadMultiPage>
        </telerik:RadPane>
    </telerik:RadSplitter>
     
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="TreeView1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadListView1" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
 
    </form>
</body>
</html>
Jason Bourdette
Top achievements
Rank 1
 answered on 31 Jan 2015
2 answers
203 views
I have toyed around with adding title="test" to the <tr> and <td> tags that get generated when sending the RadGrid to Excel with no success.  Is there a way with HTML Excel to push tooltips across?
Dan
Top achievements
Rank 1
 answered on 30 Jan 2015
3 answers
364 views

 

Hello,

<
telerik:GridTemplateColumn UniqueName="StatusColumn" HeaderText="Approved Status">

 

 

<ItemTemplate>

 

 

<asp:Label id="lblStatus" runat="server">

 

<%

# DataBinder.Eval(Container.DataItem, "status") %>

 

 

</asp:Label>

 

 

</ItemTemplate>

 

 

<EditItemTemplate>

 

 

<asp:DropDownList id="ddlApprovalStatus" runat="server" />

 

 

</EditItemTemplate>

 

 

<ItemStyle Width="40px" />

 

 

</telerik:GridTemplateColumn>

I need to find this lblStatus in ItemDataBound event. How can i do that?
I tried these ways, but always got Null in labelStatus

 

 


Label
labelStatus = (Label)item["StatusColumn"].FindControl("labelStatus");

 

 

 

Label

 

labelStatus = (Label)((Telerik.Web.UI.GridEditableItem)(e.Item)).Parent.FindControl("labelStatus");

 

 

 


Thanks
Amarinder

Pedro
Top achievements
Rank 1
 answered on 30 Jan 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?