Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
164 views
Hi,
I have a radgrid that has custom filter template that consists of distinct checkboxes based on the current data. also, I have a linkbutton column that opens up a new window to edit the row. the issue im having is after a row has been edited the filter control data is not update after i call rebind.

sample grid:
lets says here's how the grid looks like when it loads

col1                          col2                     
no filter                     filter checkboxes(abc company, def company, ghi company)
edit button                abc company
edit button                def company
edit button                ghi company

then lets say u edit "abc company" to "xyz company"
then do RadGrid1.ReBind()

the "abc company" updates the gridrow perfectly to "xyz company" but the problem is the filter checkboxes remains ("abc company"..)

is there any other way to "rebind" the entire radgrid including the filter controls?

Thanks much!

                                
Rheng
Top achievements
Rank 1
 answered on 18 Oct 2012
1 answer
78 views
i am trying to get a multicolumn combo to populate but cannot get it to display correctly

the combo is as follows:-

<telerik:RadComboBox ID="comboBoxBoard" runat="server" Filter="Contains" EmptyMessage="Boarding at"
    Height="150px" Width="250px" EnableLoadOnDemand="true" ShowMoreResultsBox="true"
    Font-Bold="true" Font-Size="120%" Font-Italic="false" CssClass="CustomRadComboxCssClass"
    Skin="50pxOffice2007" EnableEmbeddedSkins="false" ItemRequestTimeout="500" EnableVirtualScrolling="true"
    MarkFirstMatch="true" AllowCustomText="false" OnClientItemsRequesting="OnClientItemsRequesting_DubBus_Board"  >
    <WebServiceSettings Method="GetStopDataByRouteTest" Path="~/Templates/public/RoutePlannerService/RTPIWebServiceProxy.asmx"  />
    <HeaderTemplate>
        <ul>
            <li class="col1">Value</li>
            <li class="col2">No</li>
            <li class="col3">Address</li>
            <li class="col4">Location</li>
            <li class="col5">Stage</li>
        </ul>
    </HeaderTemplate>
    <ItemTemplate>
        <li class="col1">
            <%# DataBinder.Eval(Container, "Value")%>
        <li class="col2">
            <%# DataBinder.Eval(Container, "Text")%>
        <li class="col3">
            <%# DataBinder.Eval(Container, "Attributes['Address']")%>
        <li class="col4">
            <%# DataBinder.Eval(Container, "Attributes['Location']")%>
        <li class="col5">
            <%# DataBinder.Eval(Container, "Attributes['Stage']")%>
    </ItemTemplate>
</telerik:RadComboBox>



then the webservice call looks like this....

[WebMethod] // Cached for 24 hours
 public RadComboBoxData GetStopDataByRouteTest(RadComboBoxContext context)
 {
     //string route = context["Text"].ToString();
     //string direction = context["Direction"].ToString();
     //string numberOfItems = context["NumberOfItems"].ToString();
 
     string route = "1";
     string direction = "I";
     string numberOfItems = "0";
 
     try
     {
 
         RadComboBoxData comboData = new RadComboBoxData();
 
         var dtBoarding = GetStopByRouteAndDirection(route, direction);
 
 
         if (dtBoarding.Rows.Count > 0)
         {
 
             int itemsCount;
             int.TryParse(numberOfItems, out itemsCount);
 
             int itemOffset = itemsCount;
             int endOffset = Math.Min(itemOffset + ITEMS_PER_REQUEST, dtBoarding.Rows.Count);
             comboData.EndOfItems = endOffset == dtBoarding.Rows.Count;
 
             List<RadComboBoxItemData> result = new List<RadComboBoxItemData>(endOffset - itemOffset);
             foreach (DataRow dataRow in dtBoarding.Rows)
             {
 
                 RadComboBoxItemData itemData = new RadComboBoxItemData();
 
                 string stopNumber = dataRow["StopNumber"].ToString();
                 string address = dataRow["Address"].ToString();
                 string location = dataRow["Location"].ToString();
                 string stage = (dataRow["StageNumber"].ToString() != string.Empty ? dataRow["StageNumber"].ToString() : "");
 
                 itemData.Value = stopNumber;
                 itemData.Text = stopNumber;
                 itemData.Attributes.Add("Address", address);
                 itemData.Attributes.Add("Location", location);
                 itemData.Attributes.Add("Stage", stage);
                 result.Add(itemData);
             }
 
             comboData.Message = GetStatusMessage(endOffset, dtBoarding.Rows.Count);
             comboData.Items = result.ToArray();
 
         }
 
         if (comboData.Items == null)
             comboData.Items = new RadComboBoxItemData[0];
 
         return comboData;
     }
     catch (Exception ex)
     {
         return null;
     }
 
 }


running an old version of the controls:- v2.0.50727


Any help is greatly appreciated

Cheers,
Craig



Craig
Top achievements
Rank 1
 answered on 18 Oct 2012
2 answers
97 views
I need to check for customer pricing and or volume pricing before updating grid. Why does this not work?

protected void RadCartGrid1_UpdateCommand(object sender, GridCommandEventArgs e)
        {
            GridEditableItem editedItem = e.Item as GridEditableItem;
            
            string itemNumber = editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["Itemnumber"].ToString();
            int lineID = Convert.ToInt32(editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["LineID"].ToString());
            string custNum = editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["CustomerNumber"].ToString();
            int qty = Convert.ToInt32(editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["Quantity"].ToString());
           
            //CHECK FOR CUSTOMER PRICING OR QTY BREAK PRICING.
            updateCart.UPDateItem(itemNumber, lineID, custNum, qty);
            RadCartGrid1.Rebind();
        }

Jayesh Goyani
Top achievements
Rank 2
 answered on 18 Oct 2012
1 answer
195 views
HI
I use stylesheetmanager to load my styles 
but now I need to change the logo for my server side events
so I put this on pageload
If Not Session("folderStyle") = Nothing Then
               Dim link As New HtmlLink()
                link.Href = Session("folderStyle")
                link.Attributes.Add("rel", "stylesheet")
                link.Attributes.Add("type", "text/css")
                Page.Header.Controls.Add(link)
            End If

So when I load the new styel I overwrite the definitions in the common stylessheetmanager references
--
the problem is that Stylesheetmanager load the styles at the last row of html before </head>tag
so the result is 
<link href="/css/ProdottiManzi/English/stile.css" rel="stylesheet" type="text/css" />
<link href="/Telerik.Web.UI.WebResource.axd?compress=1&_TSM_CombinedScripts_=%3b%3b%7c634859195287498065%3a94dbb91c%3a58260d52%3a267fe04e%3bTelerik.Web.UI%2c+Version%3d2012.2.912.40%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3ait-IT%3a6aabe639-e731-432d-8e00-1a2e36f6eee0%3aed2942d4%3a53e1db5a%3ad126a8ef%3a92753c09%3a91f742eb%3a4f5793d0%3afe53831e%3bTelerik.Web.UI.Skins%2c+Version%3d2012.2.912.40%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3ait-IT%3ab0377b55-749e-4497-8000-b9ed5bce0744%3a6856648a%3af7a27b73%3a261be263" type="text/css" rel="stylesheet" /><title>
 
</title></head>

and as you can see my definition is before and not after
telerik sheets and mine used in stylesheetmanager

is there some property to change or my I add a style reference at runtime ?
thanks




Kate
Telerik team
 answered on 18 Oct 2012
3 answers
276 views
I have a dynamically added usercontrol that dynamically creates a TabStrip and associated PageViews from a database. For SEO purposes what I want this to do is create the PageViews for some of the tabs initially but also have some of the Tabs that will dynamically add thier PageViews on TabClick. Some of these also get additional user controls added to the PageView.

The problem is that the tabs with PageViews work fine until I click one that loads another page OnPostBack. Once the new PageView is dynamacally added OnPostBack I loose all of the ones that were originally created.

I believe I need to use the multipage PageViewCreated event to persist the dynamically created controls inside a RadPageView such as what is shown on this demo http://demos.telerik.com/aspnet-ajax/tabstrip/examples/applicationscenarios/loadondemand/defaultcs.aspx.

My problem is I am adding the content to the initially created PageViews by placing it into a Literal using Controls.Add which works fine initially. The problem is I can't seem to find it using e.PageView.FindControl to persit it in the PageViewCreated event below which always shows "PageView not found" in the code below.

Any help would be greatly appreciated!

Thanks in advance,
Dave

protected void Page_Load(object sender, EventArgs e)
       {
           if (!Page.IsPostBack)
           {
               LoadPageTabs(intControlID);
 
               if (Convert.ToInt32(SessionHandler.UserLevel) > 9)
               {
                   RadMenu1.Visible = true;
                   ScriptBlock1.Visible = true;
                   RadTabStrip1.OnClientContextMenu = "ShowRadMenu";
                   RadTabStrip1.OnClientTabSelected = "OnClientTabSelected";
               }
 
               ConfigureRadEditor();
           }
 
       }
 
       protected void LoadPageTabs(int intPageID)
       {
           PageLogic pl = new PageLogic();
           DataTable dt = pl.GetPageTabs(0, intPageID, 0);
           if (dt.Rows.Count > 0)
           {
 
               if (!Page.IsPostBack)
               {
                   lblPgTabID.Text = dt.Rows[0]["PgTabID"].ToString();   
               }
 
               foreach (DataRow dr in dt.Rows)
               {
                   try
                   {
                       AddTab(Convert.ToInt32(dr["PgTabID"].ToString()), Convert.ToInt32(dr["ParentID"].ToString()), dr["TabName"].ToString(), Convert.ToInt32(dr["ShowPv"].ToString()), dr["PvContent"].ToString(), dr["PvControl"].ToString(), Convert.ToInt32(dr["PvControlID"].ToString()));
                   }
                   catch (Exception)
                   {
                       throw;
                   }
               }
           }
           else
           {
               phAddTab.Visible = true;
               phTabs.Visible = false;
           }
       }
 
 
       private void AddTab(int intPgTabID, int intParentID, string tabName, int intShowPv, string pvContent, string pvControl, int pvControlID)
       {
           RadTab ParentTab = new RadTab();
           //tab.ID = "tb" + tabName;
           ParentTab.Text = tabName;
           ParentTab.Value = intPgTabID.ToString();
           ParentTab.Attributes.Add("TabID", intPgTabID.ToString());
           RadTabStrip1.Tabs.Add(ParentTab);
 
           if (intParentID < 0)
           {
               PageLogic pl = new PageLogic();
               DataTable dt = pl.GetPageTabs(0, 0, intPgTabID);
               if (dt.Rows.Count > 0)
               {
                   int rowcnt = 0;
                   foreach (DataRow dr in dt.Rows)
                   {
                       try
                       {
                           RadTab ChildTab = new RadTab();
                           ChildTab.Text = dr["TabName"].ToString();
                           ChildTab.Value = intPgTabID.ToString();                         
                           ChildTab.Attributes.Add("TabID", dr["PgTabID"].ToString());
                           ParentTab.Tabs.Add(ChildTab);
                           if (intShowPv > 0)
                           {
                               AddPageView(ChildTab, Convert.ToInt32(dr["PgTabID"].ToString()), dr["PvContent"].ToString(), dr["PvControl"].ToString(), Convert.ToInt32(dr["PvControlID"].ToString()));
                           }
                           if (rowcnt == 0)
                           {
                               ChildTab.Selected = true;
                           }
 
                           rowcnt++;
                            
                       }
                       catch (Exception)
                       {
                           throw;
                       }
                   }
               }
 
           }
 
           if (intParentID < 1)
           {
               if (intShowPv > 0)
               {
                   AddPageView(ParentTab, intPgTabID, pvContent, pvControl, pvControlID);
               }
           }
 
       }
 
 
       private void AddPageView(RadTab tab, int intPgTabID, string pvContent, string pvControl, int pvControlID)
       {
           Literal litPvContent = new Literal();
           litPvContent.Text = pvContent;
           litPvContent.ID = "litPv" + intPgTabID.ToString();
 
           RadPageView pageView = new RadPageView();
           // pageView.ID = tabName;
            
           pageView.ID = intPgTabID.ToString();
           pageView.Controls.Add(litPvContent);
            
           if (pvControl.Length > 0)
           {
               UserControl userControl = (UserControl)this.LoadControl(pvControl);
               ((CustomControl)userControl).ID = "Cntl" + intPgTabID.ToString();
               ((CustomControl)userControl).intControlID = pvControlID;
               ((CustomControl)userControl).intPgMode = 2;
               pageView.Controls.Add(userControl);
           }
 
           RadMultiPage1.PageViews.Add(pageView);
           tab.PageViewID = pageView.ID;
       }
 
 
       private void AddHiddenPageView(RadTab tab)
       {
           int intPgTabID = Convert.ToInt32(tab.Value);
           PageLogic pl = new PageLogic();
           DataTable dt = pl.GetPageTabs(intPgTabID, 0, 0);
           if (dt.Rows.Count > 0)
           {
               Literal litPvContent = new Literal();
               litPvContent.Text = dt.Rows[0]["pvContent"].ToString();
 
               RadPageView pageView = new RadPageView();
               // pageView.ID = tabName;
 
               pageView.ID = "pv" + intPgTabID.ToString();
               pageView.Controls.Add(litPvContent);
               //pageView.Visible = false;
 
 
               if (dt.Rows[0]["pvControl"].ToString().Length > 0)
               {
                   UserControl userControl = (UserControl)this.LoadControl(dt.Rows[0]["pvControl"].ToString());
                   ((CustomControl)userControl).ID = "Cntl" + intPgTabID.ToString();
                   ((CustomControl)userControl).intControlID = Convert.ToInt32(dt.Rows[0]["pvControlID"].ToString());
                   ((CustomControl)userControl).intPgMode = 2;
                   pageView.Controls.Add(userControl);
               }
 
               RadMultiPage1.PageViews.Add(pageView);
               tab.PageViewID = pageView.ID;
           }
       }
 
       protected void RadMultiPage1_PageViewCreated(object sender, RadMultiPageEventArgs e)
       {
           Literal litPvContent = new Literal();
           litPvContent.ID = "litPv1" + e.PageView.ID.ToString();
 
           Literal litPvContent1 = (Literal)e.PageView.FindControl("litPv" + e.PageView.ID.ToString());
 
           if (litPvContent1 != null)
           {
               litPvContent.Text = litPvContent1.Text;
               e.PageView.Controls.Add(litPvContent);
           }
           else
           {
               litPvContent.Text = "PageView Not Found";
           }
 
           e.PageView.Controls.Add(litPvContent);
 
           //string userControlName = e.PageView.ID + "CS.ascx";
 
           //Control userControl = Page.LoadControl(userControlName);
           //userControl.ID = e.PageView.ID + "_userControl";
 
           //e.PageView.Controls.Add(userControl);
 
       }
 
       protected void RadTabStrip1_TabClick(object sender, RadTabStripEventArgs e)
       {       
           AddHiddenPageView(e.Tab);
           e.Tab.PageView.Selected = true;
       }

Nencho
Telerik team
 answered on 18 Oct 2012
1 answer
70 views
When a user modifies a schedule is there a way to detect on the server if the appointment and the modified appointment are the same, in other words, there are no changes? Or client side is there a way to simply call the cancel submit when save is clicked with no changes?

I cannot find any way to do a compare on the appointment and the modified appointment that is built in and would cover all information passed from the form.

Thanks!
Plamen
Telerik team
 answered on 18 Oct 2012
1 answer
89 views
Hi there,

while placing a long name in Split button of rad ToolBar. I am getting a white backGround Color behind the button text on Mouse over.
Below is code snippet.

<telerik:RadToolBar ID="testId" runat="server" Skin="Outlook">
                    <Items>
                        <telerik:RadToolBarButton runat="server" CommandName="cmd1" ToolTip="cmd"  ImageUrl="./cmd.png" />
                        <telerik:RadToolBarButton IsSeparator="true" />
                        <telerik:RadToolBarSplitButton CommandName="textoo1" Value="textoo1
" Width="100%" OuterCssClass="../cmd.png"  >
                        <Buttons>
                               <telerik:RadToolBarButton runat="server" Text="ddddddddddddddddddddddddddddd dddddddddddddddddddddddddddaasassakk kkkkkkkkkkkkk kkkkkkkkkkkkkkkkkk" ></telerik:RadToolBarButton>
                        </Buttons>
                        </telerik:RadToolBarSplitButton
                    </Items>
                </telerik:RadToolBar>
Kate
Telerik team
 answered on 18 Oct 2012
0 answers
123 views
I have 5 web applications running on the same server. The code is identical between each application, differences being web.config, theme, etc.  Three of the applications upload files successfully while the other two fail with the following event being logged : "The process cannot access the file because it is being used by another process."

I'm fairly convinced this is an environmental problem, but I've triple checked and all of the applications are set-up the same in IIS and the permisssions on the folders are also the same.

Also, the files are uploaded to the temp directory and remain as random named files, and the error occurs when I clcik the "Save Documents" built in button.

Does anyone have any idea's on what could be causing this?

Thanks,
Joe
Joseph
Top achievements
Rank 1
 asked on 18 Oct 2012
3 answers
100 views
Hi

i am using radcalender. i need to display calender  month view horizontally .
everything is working fine but problem is that its not hiding the OtherMonthsDay name.

<telerik:RadCalendar ID="rcJan" runat="server" SingleViewColumns="31"
    SingleViewRows="1" FocusedDate="2012-01-01" ShowOtherMonthsDays="false">
</telerik:RadCalendar>
Its showing only 24 days from month.
Thanks
Vasil
Telerik team
 answered on 18 Oct 2012
2 answers
68 views
I try:
radChart1.PloatArea.Appearance.Dimensions.AutoSize = false;
radChart1.PloatArea.Appearance.Dimensions.Height = 300;
radChart1.PloatArea.Appearance.Dimensions.Width = 800;

The line: radChart1.PloatArea.Appearance.Dimensions.Height = 300; its work, but the line width no.

How can I do to enlarge(width) my ploatarea? How do I do to align all Chart Area?

Ciro
Top achievements
Rank 2
 answered on 18 Oct 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?