Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
219 views
Hi,

I have a site.master page which contians a radmenu. I have another nested master page nested from site.master called submaster . I was trying to get the menu selected value in the pageload event of the submaster.

This code is in the submaster  page_load event

RadMenu cMenu = (RadMenu)Master.FindControl("Radmenu1");

 

string cItem = cMenu.SelectedValue;

Here I am getting cItem as null. I have populated the Text and Value properties of every menu item in the site.master page. Is the syntax I am using correct? Any help is appreciated.

I have a default page created from the submaster which displays the contents.
I tried to put the same code in the default.aspx page also, but I am not getting the selected value.

Thanks
JK

 

 

Veronica
Telerik team
 answered on 03 Nov 2010
1 answer
60 views
Hi,

I have a two RadTextBox controls on the page. When the focus moves out of both of them (onblur event) the RadWindow is getting called from javascript. On RadWindow user have a choice to select a value or click Cancel button and in both cases the window will be closed. If the user selected a value the RadTextBoxes will be populated with selected value and focus will be moved to next field.
Now, when the user hits Cancel button the focus should move to the first RadTextBox. Instead the RadWindow opens-up again and will do so as long as user hits Cancel button. It looks like when I'm setting the focus to the first RadTextBox somehow the onblur event gets fired again.
We started experiencing this problem after switching to version 2010.2.713.35 from 2008.3.1314.35.

Any help would be greatly appreciated.
Thanks.
Georgi Tunev
Telerik team
 answered on 03 Nov 2010
3 answers
311 views

 

Hi,

 

I am having a radgrid with a Date field in dd/MM/yyyy format as per your site’s codes. I am having problem with filtering with Date-field in the grid, where I am getting an error on “filterItem.OwnerTableView.Rebind(); , saying “Telerik.Web.UI.ParseException: Expression expected”.  My code is as follows

 

Any idea , where I am wrong?

 

 

 

===================================

 

 

<telerik:RadGrid ID="grdActionList" Skin="WebBlue"

                                runat="server" GridLines="None"

                                AutoGenerateColumns="False"

                                AllowSorting="True"

                                AllowFilteringByColumn = "true"

                                AllowPaging="True" PageSize="10"

                                OnNeedDataSource="grdActionList_NeedDataSource"

                                OnItemCommand="grdActionList_ItemCommand">

                               

                                <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>                               

                                <MasterTableView DataKeyNames="Action_Id" CommandItemDisplay="Top" EditMode="PopUp">

                                <CommandItemSettings ShowAddNewRecordButton="false"/>

                                <EditFormSettings PopUpSettings-Modal="true" />

                                <Columns>

 

                                    <telerik:GridBoundColumn DataField="Action_Id" DataType="System.Int32"

                                        HeaderText="Action_Id" ReadOnly="True" SortExpression="Action_Id"

                                        UniqueName="Action_Id" Visible="false" >

                                    </telerik:GridBoundColumn>

                                   

                                    <telerik:GridBoundColumn DataField="Status" DataType="System.Int32" Visible="false"

                                        UniqueName="Status" ReadOnly="true">

                                    </telerik:GridBoundColumn>

                                    

                                    <telerik:GridBoundColumn DataField="Content_Id" DataType="System.Int32"

                                        HeaderText="Content_Id" SortExpression="Content_Id"

                                        UniqueName="Content_Id" ReadOnly="true" Visible="false">

                                    </telerik:GridBoundColumn>

                                   

                                   

                                     <telerik:GridBoundColumn DataField="Create_Date" DataFormatString="{0:dd/MM/yyyy}"

                                        HeaderText="Created On" SortExpression="Create_Date" ItemStyle-Width="150"

                                        UniqueName="Create_Date" ReadOnly="true">

                                    </telerik:GridBoundColumn>

                                   

                                    <telerik:GridBoundColumn DataField="JOMC_ID"

                                        HeaderText="Unique Id" SortExpression="JOMC_ID" ItemStyle-Width="150"

                                        UniqueName="JOMC_ID" ReadOnly="true">

                                    </telerik:GridBoundColumn>

                                   

                                    <telerik:GridBoundColumn DataField="Module_Content_Text"

                                        HeaderText="Action name" SortExpression="Module_Content_Text"

                                        UniqueName="Module_Content_Text" ItemStyle-Width="450">

                                    </telerik:GridBoundColumn>

                                   

                                  

                                </Columns>

                                </MasterTableView>

                                <ClientSettings EnableRowHoverStyle="true"></ClientSettings>

                                </telerik:RadGrid>

 

protected void Page_Load(object sender, EventArgs e)

    {

        if (!IsPostBack)

        {

            displayActionGrid();

        }

 

    }

 

 

 

 

    protected void grdActionList_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)

    {

        #region --------------Filtering-------------------------------

        if ((e.CommandName == RadGrid.FilterCommandName ) && (((Pair)e.CommandArgument).Second.ToString() == "Create_Date") &&

            (((Pair)e.CommandArgument).First.ToString() != "NoFilter"))

                      

        {

          e.Canceled = true;

          GridFilteringItem filterItem = (GridFilteringItem)e.Item;

          //string currentPattern = (TextBox)filterItem(((Pair)e.CommandArgument).Second).Controls(0).Text;

          //string currentPattern = "{0:dd/MM/yyyy}";

          string currentPattern = "dd/MM/yyyy";

          string filterPattern = "";

          string filterPatternAssist= "";

          //char sep = "a";

          if (currentPattern.IndexOf(" ") != -1)

          {

            currentPattern = currentPattern.Replace(" ", "/");

          }

          string[] vals = currentPattern.Split('/');

          string filterOption = Convert.ToString(((Pair)e.CommandArgument).First);

 

          if (filterOption != "IsNull" && filterOption != "NotIsNull")

          {

            if (vals.Length > 3)

            {

                filterPatternAssist = vals[4] + "/" + vals[3] + "/" + vals[5];

            }

            filterPattern = vals[1] + "/" + vals[0] + "/" + vals[2];

          }

 

          GridBoundColumn dateColumn = (GridBoundColumn)e.Item.OwnerTableView.GetColumnSafe( "Create_Date");

 

          switch(filterOption)

          {

                        case "EqualTo":

                           filterPattern = "[Create_Date] = '" + filterPattern + "'";

                           dateColumn.CurrentFilterFunction = GridKnownFunction.EqualTo;

                           break;

                        case "NotEqualTo":

                           filterPattern = "Not [Create_Date] = '" + filterPattern + "'";

                           dateColumn.CurrentFilterFunction = GridKnownFunction.NotEqualTo;

                           break;

                        case "GreaterThan":

                           filterPattern = "[Create_Date] > '" + filterPattern + "'";

                           dateColumn.CurrentFilterFunction = GridKnownFunction.GreaterThan;

                           break;

                        case "LessThan":

                           filterPattern = "[Create_Date] < '" + filterPattern + "'";

                           dateColumn.CurrentFilterFunction = GridKnownFunction.LessThan;

                           break;

                        case "GreaterThanOrEqualTo":

                           filterPattern = "[Create_Date] >= '" + filterPattern + "'";

                           dateColumn.CurrentFilterFunction = GridKnownFunction.GreaterThanOrEqualTo;

                           break;

                        case "LessThanOrEqualTo":

                           filterPattern = "[Create_Date] <= '" + filterPattern + "'";

                           dateColumn.CurrentFilterFunction = GridKnownFunction.LessThanOrEqualTo;

                           break;

                        case "Between":

                           filterPattern = "'" + filterPattern + "' <= [Create_Date] AND [Create_Date] <= '" + filterPatternAssist + "'";

                           dateColumn.CurrentFilterFunction = GridKnownFunction.Between;

                           break;

                        case "NotBetween":

                           filterPattern = "[Create_Date] <= '" + filterPattern + "' OR [Create_Date] >= '" + filterPatternAssist + "'";

                           dateColumn.CurrentFilterFunction = GridKnownFunction.NotBetween;

                           break;

                        case "IsNull":

                           break;

                        case "NotIsNull":

                           break;

           }

          foreach (GridColumn column in grdActionList.MasterTableView.Columns)

          {

            if (column.UniqueName != "Create_Date")

            {

              column.CurrentFilterFunction = GridKnownFunction.NoFilter;

              column.CurrentFilterValue = string.Empty;

            }

          }

          Session["filterPattern"] = filterPattern;

 

          dateColumn.CurrentFilterValue = currentPattern;

          filterItem.OwnerTableView.Rebind();

            

        }

        //Add more conditional checks for commands here if necessary

        else if (e.CommandName != RadGrid.SortCommandName && e.CommandName != RadGrid.PageCommandName)

        {

          Session["filterPattern"] = null;

          GridBoundColumn dateColumn = (GridBoundColumn)e.Item.OwnerTableView.GetColumnSafe( "Create_Date");

          dateColumn.CurrentFilterFunction = GridKnownFunction.NoFilter;

          dateColumn.CurrentFilterValue = string.Empty;

        }

 

        #endregion

 

 

    }

 

 

    #region Radgrid integration

    private void displayActionGrid()

    {

        JOMCMiddleWare.BL.Actions oAction = new JOMCMiddleWare.BL.Actions();

        DataTable dt = new DataTable();

        oAction._Company_Id = System.Convert.ToInt32(Session[JOMCSession.__Session_Company_Id]);

        oAction._Language_Id = System.Convert.ToInt32(Session[JOMCSession.__Session_Lanuage_Id]);

        dt = oAction.GetDataAllAction();

        grdActionList.DataSource = dt;

        grdActionList.DataBind();

    }

 

    private DataTable GridSource

    {

        get

        {

            JOMCMiddleWare.BL.Actions oAction = new JOMCMiddleWare.BL.Actions();

            DataTable dt = new DataTable();

            oAction._Company_Id = System.Convert.ToInt32(Session[JOMCSession.__Session_Company_Id]);

            oAction._Language_Id = System.Convert.ToInt32(Session[JOMCSession.__Session_Lanuage_Id]);

            dt = oAction.GetDataAllAction();

            return dt;

        }

    }

 

    protected void grdActionList_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)

    {

        grdActionList.DataSource = this.GridSource;

        //----------MS------26-10-------------

        if (Session["filterPattern"] != null)

        {

            grdActionList.MasterTableView.FilterExpression = (string)Session["filterPattern"];

        }

        //----------ME------------------

    }

 

 

    #endregion

Thanks!!

 

Radoslav
Telerik team
 answered on 03 Nov 2010
1 answer
109 views
I am creating an application where i need to display images as slideshow. I am using radwindow for displaying images as slide show.
The problem is that the rad window opens only inside my application.  i need to view the slideshow in full screen, ie i need to use the entire screen to show my image and i am unable to do it.
Is there any solution where i can open my slideshow page as a seperate popup page where i can move the window any where in the screen...
now i am able to move the radwindow only inside my web application..
Georgi Tunev
Telerik team
 answered on 03 Nov 2010
1 answer
187 views
Hi there
i am using radsitemap in listview and then bind radsitemap to Listview well it works fine but it doesnt show parent node and therefore nodelines.please refer code below
<ItemTemplate>
                         <li class="staff-item">
                             <div class="photo-container">
                                  <a href='<%# DataBinder.Eval(Container.DataItem,"PageUrl") %>' >
                                     <img src='<%# DataBinder.Eval(Container.DataItem,"Photo") %>' alt="" height="110" width="90"/>
                                  </a>
                             </div>
                             <div class="data-container">
                                  <ul>
                                     <li>
                                        <a href='<%# DataBinder.Eval(Container.DataItem,"PageUrl") %>'>
                                            <%# DataBinder.Eval(Container.DataItem, "Name")%>
                                        </a>
                                     </li>
                                     <li><%# DataBinder.Eval(Container.DataItem, "PrimaryTitle")%></li>
                                     <li>
                                      <!-- <%# DataBinder.Eval(Container.DataItem, "Area")%> -->
                                        <Telerik:RadSiteMap ID="radSiteMap" DataSource='<%#DataBinder.Eval(Container.DataItem, "Areas") %>'  DataFieldID="ID" DataFieldParentID="ParentID"
                                                          DataTextField="AreaText" ShowNodeLines="true" runat="server" >
                                                                                             
                                      </Telerik:RadSiteMap>
                                    </li>
                                  </ul>
                             </div>
 
                         </li>  
                    </ItemTemplate>
public class FacultyStaff {
 
       public string ID { get; set; }
       public string Name { get; set; }
       public string Photo { get; set; }
       public string PrimaryTitle { get; set; }
       public string PageUrl { get; set; }
       public List<FacultyArea> Areas { get; set; }
       public string Area { get; set; }
   }
   public class FacultyArea {
 
       public string ID { get; set; }
       public string AreaText { get; set; }
       public string ParentID { get; set; }
   }
if (item["AreaDirectory"] != null)  {
                  /*Code to get only first area of Speciality
                  string[] Areas = item["AreaDirectory"].ToString().Split(new char[] { ';' });
                  string[] Area = Areas[0].Split(new char[] { '|' });
                  faculty.Area = Area[0]; */
 
                  /*Code To Display all areas in Telerik SiteMap Control */
                  List<FacultyArea> facultyareas = new List<FacultyArea>();
                  TaxonomyFieldValueCollection areas = (TaxonomyFieldValueCollection)item["AreaDirectory"];
                  foreach (TaxonomyFieldValue area in areas) {
                      FacultyArea facultyarea = new FacultyArea();
                      facultyarea.AreaText = area.Label;
                      facultyarea.ID = area.TermGuid;
                      facultyarea.ParentID = "46355449-ACD0-412C-A80F-9C91872B2EA0";
                      facultyareas.Add(facultyarea);
                       
                  }
                  FacultyArea parentAreas = new FacultyArea() { ID = "46355449-ACD0-412C-A80F-9C91872B2EA0", ParentID = "D59B0E15-8207-439F-8034-841887AF53D8", AreaText = "Special Areas" };
                  facultyareas.Add(parentAreas);
                  faculty.Areas = facultyareas;
                   
                }

Please advise me
Thanks
Ronak
Yana
Telerik team
 answered on 03 Nov 2010
2 answers
196 views
I have a RadWindow opened, and inside of this i open another radwindow. I want to resize the parent RadWindow, after popup radwindow is loaded. How can i achieve this behavior?
Georgi Tunev
Telerik team
 answered on 03 Nov 2010
4 answers
90 views
Hi,

I wan to change green color of WEB20 skin with some different color. I found the file Skins\Web20\Rating.Web20.css and changed the color code d4ffbc with other one... but found no effects of these changes on my project...

Please tell me what else I need to do ?
Abdul
Top achievements
Rank 2
 answered on 03 Nov 2010
2 answers
127 views
Hi,

When I use StaticHeaders="true" there is extra space coming at the end of the page. I am not sure if it is due to the same reason, but it is there.

For some scrolling it is fine, but when data is much more and scrolling is more, the page height increases. Please see attached screenshots with extra space and with no extra space. The only difference between both is having different number of data in the grid.

Also, when I click the checkbox in the grid, page scrolls to the end and then I need to scroll back to top to go to the grid again.
Atit Thaker
Top achievements
Rank 1
 answered on 03 Nov 2010
13 answers
315 views
Hey I am trying to remove the line after I am adding a new record into the RadGrid
I am writing following code into the RadGrid_InsertCommand for that.

grdLidEffectiveDateRanges.MasterTableView.ClearEditItems();

Same thing is working for me into the RadGrid_UpdateCommand call,

Can anyone help me out what is the method call to clear the line after Insertion of a new row?

Thanks,
Nikunj Patel
Princy
Top achievements
Rank 2
 answered on 03 Nov 2010
2 answers
173 views
Good day!
When I turn my browser's window all grids look well (you can see it at pic1), but two wide RadGrids overlaps the site's menu :( (you can see it at pic2)
what can I do with this grids for them to look well? all the code & style in them are like in other grids. all the columns in them are necessary.
lina fetisova
Top achievements
Rank 1
 answered on 03 Nov 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?