Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
51 views

I have a screen that contains a RadGrid where I set the GroupSetting CaseSensitive = false, and I allow filter b column.  This woks for all my columns except for a column I have set with a filter template that contains a RadComboBox.  When I select from the combo nothing gets returned.  When I run SQL Server Profiler I can see the OnNeedDataSouce query works and returns data.  If I change the grid to populate with the column being set to upper case it works.  If I Remove the CaseSensitive it works.  Why is it having an issue with the filter with a radcombo box?


<GroupingSettings CaseSensitive="false" />
 <ExportSettings>
    <Excel Format="Html" />
 </ExportSettings>
 <AlternatingItemStyle BackColor="#EEEEEE"></AlternatingItemStyle>
 <MasterTableView DataKeyNames="AdvisorBlotterID" PagerStyle-Mode="NextPrevNumericAndAdvanced">
     <Columns>
           <telerik:GridBoundColumn SortExpression="ClientName" DataField="ClientName" HeaderText="Client Name" >
                 <FilterTemplate>
                         <telerik:RadComboBox ID="RadComboBoxClientName" DataTextField="ClientName" DataValueField="ClientName" AppendDataBoundItems="true" Width="150px" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("ClientName").CurrentFilterValue %>' runat="server" OnClientSelectedIndexChanged="ClientNameIndexChanged" Skin="Office2007">
                          </telerik:RadComboBox>
                        <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
                               <script type="text/javascript">
                                    function ClientNameIndexChanged(sender, args) {
                                        var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                        if (args.get_item().get_value() == "0") {
                                                tableView.filter("ClientName", args.get_item().get_value(), "NoFilter");
                                         }
                                        else {
                                                tableView.filter("ClientName", args.get_item().get_value(), "EqualTo");
                                          }
                                 }
                              </script>
                           </telerik:RadScriptBlock>
                     </FilterTemplate>
                <ItemStyle VerticalAlign="Top" />
           </telerik:GridBoundColumn>
Vasil
Telerik team
 answered on 07 Dec 2011
3 answers
180 views
I am using Rad chart in which i am allocating the datasource as dataset that is created dynamically through an xml file, what i want is when there is no record found for particular data it shows null(zero),i want to smooth the graph according to the dynamic data ie. graph should not break in between it should be smooth, i tried implimenting empty value property but was of no help, i think i am not able to get it right. I have attached a screenshot that demonstrates my problem related to null records(zero), though its not that similar i just want to remove in between zero or null value issue.

Thanks
Peeyush Pandey
<telerik:RadChart ID="draw_graph" runat="server" Style="margin-top: -21px; margin-left: 3px;"
    Height="500px" Width="1180px" Skin="LightGreen" AutoLayout="true">
    <PlotArea>
        <XAxis MaxValue="5" MinValue="1" Step="1" LayoutMode="normal" DataLabelsColumn="Name">
            <Appearance Color="182, 182, 182" MajorTick-Color="216, 216, 216">
                <MajorGridLines Color="216, 216, 216" PenStyle="Solid" />
                <TextAppearance TextProperties-Color="51, 51, 51">
                </TextAppearance>
            </Appearance>
            <AxisLabel>
                <TextBlock>
                    <Appearance TextProperties-Color="51, 51, 51">
                    </Appearance>
                </TextBlock>
            </AxisLabel>
        </XAxis>
        <YAxis>
            <Appearance Color="182, 182, 182" MajorTick-Color="216, 216, 216" MinorTick-Color="223, 223, 223">
                <MajorGridLines Color="216, 216, 216" />
                <MinorGridLines Color="223, 223, 223" />
                <TextAppearance TextProperties-Color="51, 51, 51">
                </TextAppearance>
            </Appearance>
            <AxisLabel Visible="true">
                <TextBlock Text="% ( In Percent )" Appearance-TextProperties-Color="Orange" Appearance-TextProperties-Font="Bold">
                    <Appearance TextProperties-Color="Orange" TextProperties-Font="Bold">
                    </Appearance>
                </TextBlock>
            </AxisLabel>
        </YAxis>
        <Appearance>
            <FillStyle FillType="Solid" MainColor="White">
            </FillStyle>
            <Border Color="182, 182, 182" />
        </Appearance>
    </PlotArea>
    <ChartTitle>
        <Appearance Position-AlignedPosition="Top">
            <FillStyle MainColor="">
            </FillStyle>
        </Appearance>
        <TextBlock Text="Company Analysis" Appearance-Position-AlignedPosition="Top">
            <Appearance TextProperties-Color="Black" TextProperties-Font="Arial, 12pt">
            </Appearance>
        </TextBlock>
    </ChartTitle>
    <Appearance Corners="Round, Round, Round, Round, 7">
        <FillStyle FillType="ComplexGradient">
            <FillSettings GradientMode="Horizontal">
                <ComplexGradient>
                    <telerik:GradientElement Color="236, 236, 236" />
                    <telerik:GradientElement Color="248, 248, 248" Position="0.5" />
                    <telerik:GradientElement Color="236, 236, 236" Position="1" />
                </ComplexGradient>
            </FillSettings>
        </FillStyle>
        <Border Color="130, 130, 130" />
    </Appearance>
    <Legend>
        <Appearance Overflow="Row" Position-AlignedPosition="Bottom" Dimensions-Margins="17.6%, 3%, 3px, 6px"
            Dimensions-Paddings="2px, 8px, 6px, 3px">
            <ItemMarkerAppearance Figure="Square" FillStyle-MainColor="Green">
                <Border Width="0" />
            </ItemMarkerAppearance>
            <FillStyle>
            </FillStyle>
            <Border Width="1" />
        </Appearance>
    </Legend>
</telerik:RadChart>
Peshito
Telerik team
 answered on 07 Dec 2011
1 answer
74 views
i have a widget which has a grid.I m importing inbuilt export functionality of RadControl.on clicking ExportToExcel icon, postBack occurs and my radgrid shows all those columns only that i want to show in exported document,and all the radgrid columns becom disable i.e. its ajaxenable property becomes false..i referred telerik export demo 
Shinu
Top achievements
Rank 2
 answered on 07 Dec 2011
5 answers
174 views
Hi,

I'm trying to create a grid of variable size based on the datatable that feeds it.

Currently the datatable consists of a first static column, and then any number of dynamically generated columns. I would like to be able to set different properties for the static and dynamic columns (size, headings, alignment etc).

What's more, I'd like to be able to add some code triggered by clicking on the column headers (only the dynamic ones).

As it stands I'm just using autogeneratecolumns="true" to create a grid that matches the data, but I fear that this will not give me the power I need to add this more complex functionality. Am I right? How would be best to go about this?

Is there a way to set the properties of autogenerated columns to the extent I require? If so I did think to maybe split the datatable and populate the static column with its specific properties separately from the dynamic ones (at least they would share the same properties) - although this would then involve mixing autogenerate/static generation and multiple data sources which might be messy in itself. I'm on something of a deadline hence why I can't just try all possibilities in the hope that one works :)

Apologies for this somewhat rambling post, but any insight into this matter would be greatly appreciated.

Cheers.
Tsvetina
Telerik team
 answered on 07 Dec 2011
1 answer
128 views
HI,
I am trying to use Rad context menu to show update/insert or delete window in  dynamic hierarchical Rad Grid.  Right clicking an item  in hierarchical grid displays a context menu with (Delete, Add and update options). How can I display edit/insert template for the selected item in a grid?
<asp:PlaceHolder ID="NGridPlaceHolder" runat="server">
      
   </asp:PlaceHolder>
          
   <input type="hidden" id="radGridClickedRowIndex" name="radGridClickedRowIndex" />
  <telerik:RadContextMenu ID="RadMenu1" runat="server" OnClientItemClicked="RadContextMenuClicked"  
     EnableRoundedCorners="true" EnableShadows="true">
     <Items>
         <telerik:RadMenuItem Text="Add" Value="Add" />
         <telerik:RadMenuItem Text="Edit" Value="Edit" />
         <telerik:RadMenuItem Text="Delete" Value="Delete" />
     </Items>
 </telerik:RadContextMenu>
function RadContextMenuClicked(sender, eventArgs) {
               
               var menuItemValue = eventArgs.get_item().get_text();
                
               switch (menuItemValue) {
                   case "Delete":
                ......................................... HOW TO SHOW DELETE WINDOW AND DELETE SELECTED RECORD  AND REFRESH GRID
                       break;..
                   case "Edit":
                    ........................... HOW TO SHOW EDIT WINDOW AND DELETE SELECTED RECORD  AND REFRESH GRID
                       break;
                   case "Add":
                    ........................... HOW TO SHOW INSERT WINDOW AND REFRESH SELECTED  GRID
 
                       break;
//Show insert/edit/delete
function RowContextMenu(sender, eventArgs) {
    senderGrid = sender;
    editEventArgs = eventArgs;
     
    var menu = $find("<%=RadMenu1.ClientID%>");
    var evt = eventArgs.get_domEvent();
 
    if (evt.target.tagName == "INPUT" || evt.target.tagName == "A") {
        return;
    }
 
    var index = eventArgs.get_itemIndexHierarchical();
    document.getElementById("radGridClickedRowIndex").value = index;
 
    sender.get_masterTableView().selectItem(sender.get_masterTableView().get_dataItems()[index].get_element(), true);
 
    menu.show(evt);
 
    evt.cancelBubble = true;
    evt.returnValue = false;
 
    if (evt.stopPropagation) {
        evt.stopPropagation();
        evt.preventDefault();
    }
}
               }
                
           }


C# code attaches context menu by

  RadGrid radGrid = new RadGrid();
   radGrid.ClientSettings.ClientEvents.OnRowContextMenu = "RowContextMenu";
I am using a programmatic hierarchical  grid and a static Context Menu. 

Any Ideas?
Prava
Princy
Top achievements
Rank 2
 answered on 07 Dec 2011
1 answer
203 views
Hi there,

I need to show a loading panel while it is still uploading, and stop showing as soon as the upload is done. The upload time may take 1-2 minutes to finish (a bunch of functions need to be executed in the back end). I have tried to search and learn some loading demos in this forum, but still cannot get what I really want. Any suggestions on how can I do this? Thanks a lot. 
Shinu
Top achievements
Rank 2
 answered on 07 Dec 2011
1 answer
106 views
I'm writing to ask how best to apply text to the RadToolBarDropDown programmatically, in C#;

Thanks in advance for any insight;  Best regards - Rob

<telerik:RadToolBar ID="RadToolBar3" runat="server" Skin="Black"  
                   BorderWidth="0px" onbuttonclick="RadToolBar3_ButtonClick">
                 <Items>
                     <telerik:RadToolBarDropDown runat="server" Font-Size="Medium">
                         <Buttons>
                             <telerik:RadToolBarButton runat="server" Text="Sign Out" Font-Size="Medium" CheckOnClick="true" CommandName="SignOut">
                             </telerik:RadToolBarButton>
                             <telerik:RadToolBarButton runat="server" Text="Contact Us" Font-Size="Medium" CheckOnClick="true" CommandName="ContactUs">
                             </telerik:RadToolBarButton>
                         </Buttons>
                     </telerik:RadToolBarDropDown>
                 </Items>
   </telerik:RadToolBar>
Shinu
Top achievements
Rank 2
 answered on 07 Dec 2011
1 answer
80 views
Hello, all.

    I am dynamically adding a checkbox to a page. I am dynamically setting autopostback to True and wiring up an event handler that runs a Procedure in the code-behind.
The procedure doesn't update any controls on the page. It just runs code that sets a cookie. I don't want the postback 'flash' to happen, so I need to dynamically set the AddAjaxSetting. But I don't have anything to put into the "updatedControl" arguement.

How can I run

 

 

Me.RadAjaxManager1.AjaxSettings.AddAjaxSetting(myCheckBox, [nothing to put here])

 ? 
It throws an "Object reference not set to an instance of an object" error.

Thanks in advance,
Dana

 

Shinu
Top achievements
Rank 2
 answered on 07 Dec 2011
2 answers
151 views
I am having a performance problem at page load with the Grid.
I have a particular grid (design code below, screen image attached) that loads 1000 records in about 2 seconds.  There is no paging, but scrolling is utilized.  That seems pretty good to me.

However, when I merge the pages from this particular project into an existing web site, the load time for this very same page, with the very same database connection, and the very same data records, goes to 10 to 12 seconds.

The only difference I can find is that the larger web site has master pages that utilize a standard script manager, not a Telerik script manager.

The display code (.aspx) for the grid is:

<asp:Panel ID="Panel1" runat="server">
    <asp:Panel ID="Panel2" Visible="false" runat="server">
        <telerik:RadGrid AutoGenerateColumns="false" ID="SignersGrid" OnItemCommand="SignersGrid_ItemCommand" runat="server" Width="765px"
            Height="410px"
            OnItemDataBound="SignersGrid_ItemDataBound" AllowSorting="true" AllowFilteringByColumn="true"
            AllowPaging="true" PageSize="8" CommandItemDisplay="Bottom"
            BorderWidth="1px" BorderColor="#999999" EnableEmbeddedSkins="true" Skin="Default"
            DataSourceID="SQLDataSource1"
            ShowStatusBar="true"
            ShowFooter="false" GridLines="None" >
            <PagerStyle Mode="NextPrevAndNumeric" />
            <GroupingSettings CaseSensitive="false" />
            <StatusBarSettings ReadyText="Ready" LoadingText="Loading..." />
                <MasterTableView AutoGenerateColumns="false" EditMode="InPlace" AllowFilteringByColumn="True"
                    ShowFooter="True" TableLayout="Auto" DataKeyNames="VoterSignatureId"  >
                    <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
                    <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                    </RowIndicatorColumn>
                    <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                    </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridBoundColumn HeaderStyle-Width="125px" HeaderText="First Name" UniqueName="FirstName" DataField="FirstName" SortExpression="FirstName" >
                    </telerik:GridBoundColumn>
 
                    <telerik:GridBoundColumn HeaderStyle-Width="125px" UniqueName="LastName" HeaderText="Last Name" DataField="LastName" SortExpression="LastName" >
                    </telerik:GridBoundColumn>
 
                    <telerik:GridBoundColumn HeaderStyle-Width="350px" UniqueName="VoterAddress" HeaderText="Address" DataField="Address" SortExpression="Address"  >
                    </telerik:GridBoundColumn >
 
                    <telerik:GridButtonColumn HeaderStyle-Width="135px" DataTextFormatString="Remove" ButtonType="PushButton" UniqueName="RemoveSigner"
                        ConfirmText="Are you certain that you want to remove this signature?"  Text="Remove"
                        HeaderText="Remove" CommandName="RemoveSigner" CommandArgument="VoterSignatureId" DataTextField="VoterSignatureId" >
                    </telerik:GridButtonColumn>
 
                    <telerik:GridBoundColumn UniqueName="VoterSignatureId" HeaderText="Id" DataField="VoterSignatureId" Visible="false" >
                    </telerik:GridBoundColumn >
                </Columns>
                <EditFormSettings>
                    <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                    </EditColumn>
                </EditFormSettings>
            </MasterTableView>
            <ClientSettings>
                <Scrolling AllowScroll="true" UseStaticHeaders="true" />
            </ClientSettings>
            <FilterMenu EnableImageSprites="False">
            </FilterMenu>
            <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
            </HeaderContextMenu>
        </telerik:RadGrid>
    </asp:Panel>
</asp:Panel>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server"
    Height="100px"  Width="100px" Transparency="50"
>
<img alt="Loading..." src="ajax-loader.gif" style="border: 0; height: 40px; width: 40px;" />
</telerik:RadAjaxLoadingPanel>

There is some code in the code-behind file.  That code is:

protected void Page_Init(object sender, EventArgs e)
{
        string griddatasource = "SELECT VoterSignatureId, PetitionId, LastName, FirstName, [Address] FROM VoterSignatures ";
        string gridWHERE = "WHERE VoterSignatureStatusId = 1 AND PetitionId = " + Request.QueryString["PID"];
        SqlDataSource1.SelectCommand = griddatasource + gridWHERE;
}
 
protected void SignersGrid_ItemCommand(Object source, Telerik.Web.UI.GridCommandEventArgs e)
{
    if (e.CommandName == "RemoveSigner")
    {
        //  First we need to get the key value of the record the user wants to remove from the lsit
        Object index = e.CommandArgument;
        Int16 iSignerRecKey = Convert.ToInt16(index);
 
        //  Now we can get the record, change it (remove it from the list), and update it
        ElectronicPetitionSystemDataContext efdc = new ElectronicPetitionSystemDataContext();
        VoterSignature vs = efdc.VoterSignatures.Single(vrec => vrec.VoterSignatureId == iSignerRecKey);
        vs.VoterSignatureStatusId = 2;
        efdc.SubmitChanges();
        this.SignersGrid.Rebind();
    }
}
 
protected void SignersGrid_ItemDataBound(Object sender, Telerik.Web.UI.GridItemEventArgs e)
// 
{
    if (e.Item is GridDataItem)
    {
        //GridDataItem dataItem = e.Item as GridDataItem;
        //Button button_Renamed = (Button)dataItem["RemoveSigner"].Controls[0];
        //button_Renamed.CommandArgument = Convert.ToString(DataBinder.Eval(e.Item.DataItem, "VoterSignatureId"));
 
        //String sMsg = "";
        //sMsg = "Are you certain that you want to remove " + Convert.ToString(DataBinder.Eval(e.Item.DataItem, "FirstName")) + "?";
 
        //  Telerik example for this is located at:
    }
}
 
protected void SignersGrid_AjaxRequest(Object sender, Telerik.Web.UI.AjaxRequestEventArgs e)
{
    if (e.Argument == "InitialPageLoad")
    {
        //System.Threading.Thread.Sleep(1000);
        this.Panel2.Visible = true;
    }
}

The screen capture of the grid is attached.

Do you have any suggestions of what I could look at to run down this severe performance change from site to site?

Thanks in advance!

Lynn


Shinu
Top achievements
Rank 2
 answered on 07 Dec 2011
1 answer
112 views
Hello,

I'm using a RadGrid with a number of GridNumericColumnEditor controls.  When in Edit Mode, I need to update Group AND Grid totals as the user updates the values in the NumericTextBoxes (via JavaScript?), not after an Update.  Is this possible?  If so, how can I do it.  I've found a number of examples that will update the Grid totals via JavaScript but, I haven't been able to find something that would update the Group totals as well.

Thanks for your help.

Jeremy
Shinu
Top achievements
Rank 2
 answered on 07 Dec 2011
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
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
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
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?