Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
302 views
I have a RadGrid where I am auto generating columns because they can changed depending on the source. And I want to display only certain columns and in a specific order. Its easiest for me to store the columns to display in a comma delimited string. I created the code below to try to do this. However it fails because in the Page_Load method the grid.MasterTableView.Columns is always empty, even though I do a DataBind first. Any idea how I can get this to work?

Thanks,
Jason

protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
        // bind
        grid.MasterTableView.DataBind();
        grid.DataBind();
  
        // columns
        var cols = grid.MasterTableView.Columns;
        foreach (GridColumn c in cols)
        {
            c.Visible = false;
        }
        // fieldNames is a comma delimited list of column names in the correct order
        var fields = fieldNames.Split(new char[',']);
        for (var j = 0; j < fields.Length; j++)
        {
            var c = cols.FindByUniqueNameSafe(fields[j]);
            if (c != null)
            {
                c.Visible = true;
                c.OrderIndex = j;
            }
        }
    }
}
Jason
Top achievements
Rank 1
 answered on 10 Jan 2013
5 answers
296 views
for test , we download the trial version of telerik and face following problems 
It Dosnot have  any problem on local Dnn Portal,but it takes us the bellow error on main website
 " Error loading RadChart inage ..." .
we added the tag Shown on first load of radchart in Web.Config > httphandler Section .
and add folder radcontrols>chart wich contains file image.aspx.
Please Guid us as soon as posible.
Lori
Top achievements
Rank 1
 answered on 10 Jan 2013
0 answers
116 views
One of our users alerted us to a problem in Chrome with the RAD grid control.  He has about 100 items and after the operation (insert/delete) completes, the grid doesn't redraw.  If you move the mouse over the rows, it will redraw around the cursor as you move it.   Once you scroll the screen, it redraws the pieces that go off screen.   See attached screenshots.

We were only able to reproduce the problem in Chrome.  It worked fine in IE and Firefox.  I was just wondering if anyone else has seen similar issues.  We had not seen such problems before and I wondered if it wasn't something broken in the last Chrome update.

Thanks!
HorseFly
Top achievements
Rank 1
 asked on 10 Jan 2013
6 answers
710 views
I'm trying to change the tab text in javascript.  I thought it would be a simple task but I haven't had any success with anything I've tried.

The first thing I tried was tab.set_text("NewValue").  This set the text property in the tab client object but didn't update the text currently visible to users. 

I then tried to get the DOM element for the tab text to update it directly using tab.get_textElement() but that comes back as null.

Does anyone have any idea how to update the tab text so it's updated in the browser?
Chris
Top achievements
Rank 1
 answered on 10 Jan 2013
2 answers
255 views
Hi there,

I cannot get the correct pagesize selected when I use AllowCustomPaging="true".
When you look in the code below I can see PAGESIZE_NEW is set to the new pagesize selected (f.e. 50) in the grHit_PageSizeChanged event.
After that it hits the grHit_NeedDataSource event. The PAGESIZE variable is set to it's original value of 25 instead of 50 like the value in the grHit_PageSizeChanged event.

Any idea?

I am using Telerik: 202.3.1016.35.


Regards,

Marcel

    <head>
        <title>HitGrid</title>
    </head>
    <body> 
        <telerik:RadGrid ID="grHit" runat="server"
            OnNeedDataSource="grHit_NeedDataSource"
            OnDetailTableDataBind="grHit_DetailTableDataBind"  OnPageSizeChanged="grHit_PageSizeChanged"
            OnItemCreated="grHit_ItemCreated">
 
            <MasterTableView AutoGenerateColumns="False"
                AllowSorting="true"
                AllowNaturalSort="false"
                AllowFilteringByColumn="true"
                AllowPaging="true"
                AllowCustomPaging="true"
                DataKeyNames="Date hit, User id, Application id, Function id">
 
                <Columns>
                    <telerik:GridDateTimeColumn UniqueName="coDateHit" HeaderText="Date"
                        MinDate="1899/12/30"
                        DataField="Date hit" >
                    </telerik:GridDateTimeColumn>
                     
                    <telerik:GridBoundColumn UniqueName="coUserName" HeaderText="User"
                        DataField="User name" >
                    </telerik:GridBoundColumn>
                     
                    <telerik:GridBoundColumn UniqueName="coFunctionName" HeaderText="Function"
                        DataField="Function name" >
                    </telerik:GridBoundColumn>
                      
                    <telerik:GridBoundColumn UniqueName="coIPAddress" HeaderText="IP address"
                        DataField="User host address" >
                    </telerik:GridBoundColumn>
                     
                    <telerik:GridBoundColumn UniqueName="coBrowser" HeaderText="Browser"
                        DataField="Browser" >
                    </telerik:GridBoundColumn>
                </Columns>
 
                <DetailTables>
                    <telerik:GridTableView Name="HitDetail"
                        AutoGenerateColumns="False"
                        ShowHeader="false"
                        Width="100%">
                         
                        <Columns>
                            <telerik:GridBoundColumn UniqueName="coColumn1"
                                DataField="Column 1" >
                            </telerik:GridBoundColumn>
                             
                            <telerik:GridBoundColumn UniqueName="coColumn2"
                                DataField="Column 2" >
                            </telerik:GridBoundColumn>
                        </Columns>
                         
                    </telerik:GridTableView>
                </DetailTables>
 
            </MasterTableView>
             
        </telerik:RadGrid>
    </body>
</html>

public partial class HitGrid : System.Web.UI.UserControl
    {
        public int WIDTH
        {
            //totale breedte
            set
            {
                grHit.Width = Unit.Percentage(value);
            }
        }
 
        override protected void OnInit(EventArgs e)
        {
            InitializeComponent();
            base.OnInit(e);
        }
 
        private void InitializeComponent()
        {
            //sorting
            Telerik.Web.UI.GridSortExpression sortExpr = new Telerik.Web.UI.GridSortExpression();
            sortExpr.FieldName = "Date hit";
            sortExpr.SortOrder = Telerik.Web.UI.GridSortOrder.Descending;
            grHit.MasterTableView.SortExpressions.AddSortExpression(sortExpr);
 
            //paging
            grHit.PageSize = Convert.ToInt16(ConfigurationManager.AppSettings.Get("Page size"));
        }
 
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //initialise
                HITGRID_INIT();
            }
        }
 
        private void HITGRID_INIT()
        {}
 
        protected void grHit_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            if (e.Item is Telerik.Web.UI.GridFilteringItem)
            {
                Telerik.Web.UI.GridFilteringItem FilterItem = e.Item as Telerik.Web.UI.GridFilteringItem;
 
                //User
                TextBox txtUserName = FilterItem["coUserName"].Controls[0] as TextBox;
                txtUserName.Width = Unit.Pixel(100);
 
                //Function
                TextBox txtFunctionName = FilterItem["coFunctionName"].Controls[0] as TextBox;
                txtFunctionName.Width = Unit.Pixel(100);
 
                //IP address
                TextBox txtIPAddress = FilterItem["coIPAddress"].Controls[0] as TextBox;
                txtIPAddress.Width = Unit.Pixel(80);
 
                //Browser
                TextBox txtBrowser = FilterItem["coBrowser"].Controls[0] as TextBox;
                txtBrowser.Width = Unit.Pixel(100);
            }
        }
 
        protected void grHit_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            int PAGESIZE = grHit.PageSize;
 
            //get hits
            NMHG.Data.NMHGHome.HOH100PF.GetHits2 HOH100PF_List = new NMHG.Data.NMHGHome.HOH100PF.GetHits2();
            HOH100PF_List.H1APID = "";
            HOH100PF_List.H1USID = "";
            HOH100PF_List.PageNumber = grHit.CurrentPageIndex;
            HOH100PF_List.Main();
 
            //fill grid
            grHit.DataSource = HOH100PF_List.HitTable;
 
            //set virtual item count
            grHit.VirtualItemCount = HOH100PF_List.COUNT;
        }
 
        protected void grHit_PageSizeChanged(object source, Telerik.Web.UI.GridPageSizeChangedEventArgs e)
        {
            int PAGESIZE_NEW = e.NewPageSize;
        }
 
        protected void grHit_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
        {
            Telerik.Web.UI.GridDataItem DataItem = (Telerik.Web.UI.GridDataItem)e.DetailTableView.ParentItem;
            switch (e.DetailTableView.Name)
            {
                case "HitDetail":     //Hit detail
 
                    //get hit
                    NMHG.Data.NMHGHome.HOH100PF.Hit HOH100PF = new NMHG.Data.NMHGHome.HOH100PF.Hit();
                    HOH100PF.H1DATE = (DateTime)DataItem.GetDataKeyValue("Date hit");          //Date hit
                    HOH100PF.H1USID = DataItem.GetDataKeyValue("User id").ToString();           //User id
                    HOH100PF.H1APID = DataItem.GetDataKeyValue("Application id").ToString();    //Application id
                    HOH100PF.H1FNID = DataItem.GetDataKeyValue("Function id").ToString();       //Function id
                    HOH100PF.GetHit();
 
                    //initialise datatable
                    DataTable HitTable = new DataTable("Hit detail data");
                    HitTable.Columns.Add("Column 1", System.Type.GetType("System.String"));
                    HitTable.Columns.Add("Column 2", System.Type.GetType("System.String"));
 
                    //Date
                    DataRow HitRow = HitTable.NewRow();
                    HitRow["Column 1"] = "Date:";
                    HitRow["Column 2"] = HOH100PF.H1DATE;
                    HitTable.Rows.Add(HitRow);
 
                    //get username
                    NMHG.Data.NMHGHome.AUUS00PF.User AUUS00PF = new NMHG.Data.NMHGHome.AUUS00PF.User();
                    AUUS00PF.USUSID = HOH100PF.H1USID;
                    AUUS00PF.GetUser();
 
                    //User
                    HitRow = HitTable.NewRow();
                    HitRow["Column 1"] = "User:";
                    HitRow["Column 2"] = AUUS00PF.USUSNM;
                    HitTable.Rows.Add(HitRow);
 
                    //get application function name
                    NMHG.Data.NMHGHome.AUAF00PF.ApplicationFunction AUAF00PF = new NMHG.Data.NMHGHome.AUAF00PF.ApplicationFunction();
                    AUAF00PF.AFAPID = HOH100PF.H1APID;
                    AUAF00PF.AFFNID = HOH100PF.H1FNID;
                    AUAF00PF.GetApplicationFunction();
 
                    //Function
                    HitRow = HitTable.NewRow();
                    HitRow["Column 1"] = "Function:";
                    HitRow["Column 2"] = AUAF00PF.AFFNNM;
                    HitTable.Rows.Add(HitRow);
 
                    //URL
                    HitRow = HitTable.NewRow();
                    HitRow["Column 1"] = "URL:";
                    HitRow["Column 2"] = HOH100PF.H1URL;
                    HitTable.Rows.Add(HitRow);
 
                    //IP address
                    HitRow = HitTable.NewRow();
                    HitRow["Column 1"] = "IP address:";
                    HitRow["Column 2"] = HOH100PF.H1ADDR;
                    HitTable.Rows.Add(HitRow);
 
                    //Platform
                    HitRow = HitTable.NewRow();
                    HitRow["Column 1"] = "Platform:";
                    HitRow["Column 2"] = HOH100PF.H1PLAT;
                    HitTable.Rows.Add(HitRow);
 
                    //Browser
                    HitRow = HitTable.NewRow();
                    HitRow["Column 1"] = "Browser:";
                    HitRow["Column 2"] = HOH100PF.H1BRWS;
                    HitTable.Rows.Add(HitRow);
 
                    //fill grid
                    grHit.DataSource = HitTable;
 
                    break;
            }
        }
    }

Marcel
Top achievements
Rank 1
 answered on 10 Jan 2013
7 answers
261 views
RadDockZone1.Docks.Sort(Function(dock1 As RadDock, dock2 As RadDock) dock1.Index.CompareTo(dock2.Index))
 
       For Each dock As RadDock In RadDockZone1.Docks
           For Each control As Control In dock.ContentContainer.Controls(0).Controls
               If (TypeOf control Is CheckBox) Then
                   checkBox = CType(control, CheckBox)
                   If checkBox.Checked Then
                       selectedWebParts.Add(dock.ID)
                   End If
               End If
           Next
       Next

I have a RadDockZone in which i am adding docks at runtime.
User can drap and drop any dock and can change their position in RadDockZone.
Now on postback, I am trying to get the docks from Raddockzone ordered be Dock index.
I am using the above code but it is not working the way I want.

Could you please help me to get the docks from Raddockzone ordered by their index.
Slav
Telerik team
 answered on 10 Jan 2013
1 answer
110 views
We have developed an application runs at intranet. When users browse the application with IE9, none of tabstrip tabs works(User cannot click anything). When I checked the client internet explorer i saw that the compability mode is active. When i disable it everything works fine. 
When users who has the IE8 and compability mode is disabled, they cannot click anything too. When they activate the compability mode everything works fine.
How could we solve this problem?
Nencho
Telerik team
 answered on 10 Jan 2013
3 answers
158 views
If I have the following controls.

        <telerik:RadCodeBlock ID="codeBlock" runat="server">
        <script type="text/javascript">
           function OnClientSeriesClicked(sender, args)
           {
              if (args.get_seriesName() != "Months")
               $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest(args.get_category());
              
           }
           function openWinNavigateUrl()
           {
              $find("<%=RadWindow_NavigateUrl.ClientID %>").show();
           }
        </script>
    </telerik:RadCodeBlock>
 
<telerik:RadHtmlChart ID="RadHtmlMainBar" Transitions="true"   runat="server"   
        Height="450px" Width="550px" OnClientSeriesClicked="OnClientSeriesClicked">
               </telerik:RadHtmlChart>
 
    <telerik:RadWindow runat="server" ID="RadWindow_NavigateUrl" NavigateUrl="/pagesModules/ComplienceDetail.aspx?Category=19791978"
        Modal="true" InitialBehaviors="Maximize" RestrictionZoneID="NavigateUrlZone">
    </telerik:RadWindow>
 
            <asp:Button ID="Button4" Text="open the window" runat="server" 
            OnClientClick="openWinNavigateUrl(); return false;" />

 

Andy
Top achievements
Rank 1
Iron
 answered on 10 Jan 2013
5 answers
437 views

Hi,
I have a scenario where im using RadTabStrip in usercontrol.This userControl is registred on .aspx page. RadStrip has 4 to 5 tabs. Each tab click should be navigated to new page with some contents.I can set the NavigateUrl="FirstTab.aspx" so that it will navigate to respective pages, But these pages don't have Tabstrip.It only contains Contents of particular page. How to load contents of page with radstrip still visible ?.  How to go about this scenario.

Attached is screenshot.

Please Suggest

Regards,
Akki
Nencho
Telerik team
 answered on 10 Jan 2013
1 answer
43 views
After I made a AjaxRequest Call, I got a message before the update panel as below automatically.  Any idea how to disable it?

Thanks.

Yingyi

8287|updatePanel|ctl21_coverageplan_ctl21_coverageplan_CoveragePlanGridViewPanel|
Andrey
Telerik team
 answered on 10 Jan 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?