Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
821 views

Hi,

I'm using radgrid with checkbox to select row in there. I have a lot of data, and I use paging in my Grid.

I think that my code is OK, when i check one row or more. When i check chekbox header, i think that my all of my data's are checked but actually

my data in other pages are not checked.

Please advise,

Thank you so much

 

Bellow is my code in aspx :

<telerik:RadGrid ID="RgTrial" runat="server" OnNeedDataSource="RgTrial_NeedDataSource" AutoGenerateColumns="false" ClientSettings-Resizing-AllowColumnResize="false"
                                ClientSettings-Resizing-AllowResizeToFit="false" ClientSettings-Resizing-EnableRealTimeResize="false" Width="1046" Height="550" ClientSettings-Scrolling-AllowScroll="true"
                                ClientSettings-Scrolling-UseStaticHeaders="true" AllowMultiRowSelection="true" AllowFilteringByColumn="true" GroupingSettings-CaseSensitive="false" AllowPaging="True" PageSize="50" EnableEmbeddedSkins="false" Skin="CustomSkin">
                                 
                                <MasterTableView DataKeyNames="Nomor,BatchNo,BatchDate,SO,SOType,SODate,BusinessUnit,BUName,POCustomer,Customer,SalesID,SalesName,IndexProduct,IndexService,GPMSA,GPMActual
                                    ,Currency,RealAmount,ExchangeRate,Amount,ServiceAmount,CollAmount,Revenue,COGS,GPMAchievement,PctgCommPaid,Formula,Commision,ActiveFlag,EditReason,Calculation,IsFinal">
                                    <Columns>
 
 
                                        <telerik:GridTemplateColumn UniqueName="CheckBoxTemplateColumn" HeaderStyle-Width="45px" ItemStyle-HorizontalAlign="Center" AllowFiltering="false">
                                            <ItemTemplate>
                                                <asp:CheckBox ID="CBSelectRow" runat="server"  AutoPostBack="True" OnCheckedChanged="CBSelectRow_CheckedChanged"  />
                                            </ItemTemplate>
                                            <HeaderTemplate>
                                                <asp:CheckBox ID="CBHeader" runat="server" AutoPostBack="True" OnCheckedChanged="CBHeader_CheckedChanged" />
                                            </HeaderTemplate>
                                        </telerik:GridTemplateColumn>
 
                                        <telerik:GridBoundColumn DataField="NOMOR" HeaderText="No" ReadOnly="true" HeaderStyle-HorizontalAlign="Center" DataType="System.String" HeaderStyle-Width="75" ShowFilterIcon="false" FilterControlWidth="60"
                                            AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo" ItemStyle-HorizontalAlign="Center" AllowFiltering="false">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="BatchNo" HeaderText="Batch No" ReadOnly="true" HeaderStyle-HorizontalAlign="Center" DataType="System.String" HeaderStyle-Width="100" ShowFilterIcon="false" FilterControlWidth="85"
                                            AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo" ItemStyle-HorizontalAlign="Center" AllowFiltering="true">
                                        </telerik:GridBoundColumn>
 

and code behind, i use c# :

 

protected void CBSelectRow_CheckedChanged(object sender, EventArgs e)
       {
           try
           {
               ((sender as CheckBox).NamingContainer as GridItem).Selected = (sender as CheckBox).Checked;
               bool checkHeader = true;
 
               foreach (GridDataItem dataItem in RgTrial.MasterTableView.Items)
               {
                   if (!(dataItem.FindControl("CBSelectRow") as CheckBox).Checked)
                   {
                       checkHeader = false;
 
                       break;
                   }
 
               }
               GridHeaderItem headerItem = RgTrial.MasterTableView.GetItems(GridItemType.Header)[0] as GridHeaderItem;
               (headerItem.FindControl("CBHeader") as CheckBox).Checked = checkHeader;
           }
 
           catch (Exception x)
           {
               Logger.Instance.LogException(System.Reflection.MethodBase.GetCurrentMethod(), x, true, Helper.Instance.GetUserID());
           }
       }
 
       protected void CBHeader_CheckedChanged(object sender, EventArgs e)
       {
           try
           {
               CheckBox headerCheckBox = (sender as CheckBox);
               foreach (GridDataItem dataItem in RgTrial.MasterTableView.Items)
               {
                   (dataItem.FindControl("CBSelectRow") as CheckBox).Checked = headerCheckBox.Checked;
                   dataItem.Selected = headerCheckBox.Checked;
                   
               }
           }
           catch (Exception x)
           {
               Logger.Instance.LogException(System.Reflection.MethodBase.GetCurrentMethod(), x, true, Helper.Instance.GetUserID());
           }
       }

Eyup
Telerik team
 answered on 30 Oct 2015
1 answer
146 views

 

Hi guys.

 

I'm new implementing radsplitbutton, I have my splitbutton inside a gridtemplateColumn declared as follows:

<telerik:GridTemplateColumn  DataField="Portal_Id" UniqueName="templateCol">
                           <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                      <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                      <ItemTemplate>
                            <asp:Label runat="server" ID="labelss" Text='<%# Bind("Portal_Id") %>' ></asp:Label>
       <telerik:RadButton runat="server"  ID="splitButton" EnableSplitButton="true" Text="Selecionar" Skin="Bootstrap" Width="200px" AutoPostBack="false" OnClientClicked="OnClientClicked" OnClientLoad="storeSplitButtonReference"></telerik:RadButton >
                           <telerik:RadContextMenu ID="RadContextMenu1" runat="server" Skin="Bootstrap"  OnClientLoad="storeContextMenuReference" >
                  <Items>
                      <telerik:RadMenuItem Text="Detalles" Value='<%# Eval("Portal_Id")%>'  NavigateUrl='<%# FriendlyUrl.Href("~/Portales/Details", DataBinder.Eval(Container,"Portal_Id"))%>' >
                          
                      </telerik:RadMenuItem>
                      <telerik:RadMenuItem Text="Editar" Value='<%# Eval("Portal_Id") %>'  NavigateUrl='<%# FriendlyUrl.Href("~/Portales/Edit",  Eval("Portal_Id"))%>' >
                      </telerik:RadMenuItem>
                      <telerik:RadMenuItem Text="Eliminar"  NavigateUrl='<%# FriendlyUrl.Href("~/Portales/Delete", Eval("Portal_Id"))%>'>
                           
                      </telerik:RadMenuItem>
                  </Items>
              </telerik:RadContextMenu>
                                         
                      </ItemTemplate>
                  </telerik:GridTemplateColumn>

What I want to do is to navigate through the navigateUrl Property of the radmenuItem and passing the portal_id wich is in a gridboundcolumn but when I click an item it redirects to the page without the portal_id, this behavior only occurs with radcontextmenu, as you can see I placed a label before the  button and bind the text property to the portal_id value and it is set correctly.

 

Can you help me to get the correct redirection with the portal_id parameter.

 

Best Regards

Cristian.

Danail Vasilev
Telerik team
 answered on 29 Oct 2015
3 answers
65 views

Hello,
we're having an issue with RadGrid object on sharepoint 2010 service pack 1environment. When we press the button to perform the update we find a javascript error that does not allow changing the value.
In our development environment we have resolved installing sharepoint service pack 2.
In our production environment  we can’t install the service pack 2. Actually we have installed the devcraft ultimate product (Version=2014.1.403.35).
Do you know if this bug is fixed in later versions or do you have a workaround in order to resolve this issue?

 

Best Regards,

Giulio

Marin
Telerik team
 answered on 29 Oct 2015
7 answers
1.7K+ views
HI,
      I am yogesh. i am working with asp.net ajax rad grid. i need to add checkbox column programmatically and should be able to select multiple rows and export to excel...could anyone help me out plz....its urgent(asp.net with c# code)
Meenakshi
Top achievements
Rank 1
 answered on 29 Oct 2015
3 answers
637 views

 

I would like to store some small SVG image files along with other information about each file as individual records in a SQL Database Table. I have not used SVG files before but I must use then as they are what customer uses/wants.

What SQL data type would I use in a table field where I could upload, download and view SVG files in and from a RadGrid.

What type of Grid column could I use to update, download and view each image in the grid view?

Really not here to discuss pro and con of storing SVG file in a SQL table field.  

I am here to ask for help and example if at all possible to store and view SVG images in a SQL Table record and view in a RadGrid Column.

 Is it doable?  I am using SQLDataSource control on ASP.NET content page as the source for the RadGrid.

 

Thank you very much for any help you can provide.

 

 

Konstantin Dikov
Telerik team
 answered on 29 Oct 2015
5 answers
220 views

Hi, I'm wondering if there is a way to dynamically ajaxify controls outside of a page load / postback event.  The specific scenario is that I have a grid that updates a user control.  The user control acts as a detail area for the items in the grid.  I would like to make it so a page or sort event on the grid does not update the user control, but a row edit or insert event does.  I tried doing this by creating a client event to handle the grid click.  If insert or edit row is clicked, I call a code-behind method to enable the user control update (calling AddAjaxSetting, and then later removing the Ajax setting).  But when I tried this, I got this error:

 

Controls cannot be ajaxified after page prerender

 

Is there another way to accomplish my goal, without doing a postback/reload of the page?  Thanks.

Maria Ilieva
Telerik team
 answered on 29 Oct 2015
3 answers
355 views

Hi

I'm adding custom special day using OnDayRender. this event is not working when i change or navigate to any other month.

here is my code

ASPX:

<telerik:RadDatePicker Calendar-DayNameFormat="Shortest" Calendar-ShowOtherMonthsDays="false" DateInput-ReadOnly="true" DatePopupButton-ImageUrl="/images/calander_icon.gif" DatePopupButton-HoverImageUrl="/images/calander_icon.gif"
                                                                  ID="rdpDeliveryDate" OnLoad="rdpDeliveryDate_Load"  runat="server" >
                                                                 <Calendar ID="Calendar1" runat="server" ShowRowHeaders="false"  OnDayRender="dayRender"  ShowFastNavigationButtons="false" FirstDayOfWeek="Sunday"></Calendar>
                                                             </telerik:RadDatePicker>
 

CS:

protected void rdpDeliveryDate_Load(object sender, EventArgs e)
       {
           (sender as RadDatePicker).MinDate = CommonLogic.CurrentGccTime().Date;
       }
 

protected void dayRender(object sender, Telerik.Web.UI.Calendar.DayRenderEventArgs e)
        {
 
if (e.Day.Date.DayOfWeek == DayOfWeek.Wednesday|| e.Day.Date.DayOfWeek == DayOfWeek.Sunday)
        {
                        // clear the default cell content (anchor tag) as we need to disable the hover effect for this cell
                        e.Cell.Text = "";
                        e.Cell.CssClass = "rcOutOfRange"; //set new CssClass for the disabled calendar day cells (e.g. look like other month days here)
 
                        // render a span element with the processed calendar day number instead of the removed anchor -- necessary for the calendar skinning mechanism
                        Label label = new Label();
                        label.Text = e.Day.Date.Day.ToString();
                        e.Cell.Controls.Add(label);
                        e.Cell.ToolTip = "Day Off";
 
                        RadCalendarDay dayoff = new RadCalendarDay();
                        dayoff.Date = e.Day.Date;
                        dayoff.IsSelectable = false;
                        dayoff.IsDisabled = true;
                        dayoff.ItemStyle.CssClass = "rcOutOfRange";
 
                        cln.SpecialDays.Add(dayoff);
                         
                    }
}

I'm using  Version 2015.2.826.45,

Visual studio 2012.

Please help me

Appreciate for Quick and best Response

 

Yasin

Konstantin Dikov
Telerik team
 answered on 29 Oct 2015
1 answer
126 views

Hi, every body,

 

Today I try to export pdf from one RadEditor ... but the function throw an nullReferenceException.

Here is my code :

 

RadEditor radEditor = new RadEditor();
radEditor.Content = "<div>Hello</div>";
radEditor.ExportSettings.FileName = "TextFile.pdf";
radEditor.ExportSettings.OpenInNewWindow = true;
radEditor.ExportToPdf();
 

Did I miss something ?

Thanks,

Corentin

RadEditor radEditor = new RadEditor();
radEditor.Content = "<div>Hello</div>";
radEditor.ExportSettings.FileName = "TextFile.pdf";
radEditor.ExportSettings.OpenInNewWindow = true;
radEditor.ExportToPdf();
RadEditor radEditor = new RadEditor();
radEditor.Content = "<div>Hello</div>";
radEditor.ExportSettings.FileName = "TextFile.pdf";
radEditor.ExportSettings.OpenInNewWindow = true;
radEditor.ExportToPdf();
Ianko
Telerik team
 answered on 29 Oct 2015
23 answers
468 views
Hello Team;

I was reading the new features in the ASP.Net 4.5 engine last night and seems like MSFT has done a great job in the "Data" handling department and has made lots of improvements. Better data binding, being able to take advantage of dataModel, be able to declare validations as attributes in our model and let it expose at client side. Use of jQuery & HTML5 for validation and so on.

Some of these features are basically part of the ASP.Net engine and some others will affect the third party controls.

I wanted to ask the team, what's the roadmap of supporting these new data binding and modeling in telerik controls, so I can plan out my development with VS2010 for now and when I should move to VS11 & .Net 4.5.

Could you please provide some ideas what the team is thinking and which Q we should plan for? Either as a reply to my post or blog post for everyone to see.
I greatly appreciate any input you can provide.

Thanks!
..Ben
Marin Bratanov
Telerik team
 answered on 29 Oct 2015
9 answers
246 views

The page still does full postback not partial post back on the project details panel, when I select drop drown list. How should I fix it?

 

 

CODE # 1

 <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="ddlSelectProject">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="divProjectInfo" LoadingPanelID="PanelProjects" />
                    </UpdatedControls>                    
                </telerik:AjaxSetting>
            </AjaxSettings>
     </telerik:RadAjaxManagerProxy>

 

 

CODE # 2​

 <table style="height: 350px;">
            <tr>
<telerik:RadAjaxLoadingPanel ID="PanelProjects" runat="server">

                     <td id="tdProjectDetails" >
                         <table>
                             <tbody>
                                 <tr>
                                       <td class="rightCell">
                                                    <span id="lblOwner" runat="server">--</span>
                                       </td>

                                  </tr>

                             </tbody>

                          </table>

                     </td>

              </telerik:RadAjaxLoadingPanel>

 

             <telerik:RadAjaxLoadingPanel ID="PanelFile" runat="server"> 

                 <td>   
                      <telerik:RadAsyncUpload ID="RadAsyncFileUpload" runat="server" MaxFileSize="2097152" AllowedFileExtensions="xls,xlsx,csv"                                   Localization-Select="Upload" MaxFileInputsCount="1"></telerik:RadAsyncUpload>                                    
                       <asp:Button ID="btnsubmitupload" runat="server" Visible="false" />
                 </td>​

              </telerik:RadAjaxLoadingPanel>​

      </tr>

</table>


Viktor Tachev
Telerik team
 answered on 29 Oct 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?