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

Posted on 13 minutes ago

i have two situations as I listed earlier:

1) needing to display a messagebox modal that shows info and has ok button - radalert seems to be the ticket here if I can get it to work

2) needing to display a usercontrol within a modal window inside of my browser window that is not a popup window - radwindow seems to be the thing to use here - but i need to have two buttons outside of the usercontrol that have "add" or "cancel" - the cancel button can just close the window - the "Add" button needs to call a public method on the usercontrol and if that returns true then it closes the window and passes back a value of what was added (guid or string) otherwise it does nothing and the radwindow continues to be displayed

here's the structure of my page

my code for this is running in a user control that is embedded in a page that has a masterpage

my masterpage has the scriptmanager component

the user control generally is structured like so:

<asp:UpdatePanel ID="MyUpdatePanel" runat="server">
    <ContentTemplate>
        <asp:FormView ID="MyFormView" runat="server" DefaultMode="Edit" DataSourceID="MyObjectDataSource">
            <EditItemTemplate>
<asp:Panel ID="Panel1" runat="server" DefaultButton="ReaderLinkButton">
                            <asp:LinkButton ID="MyLinkButton" runat="server" OnClick="MyLinkButton_Click">My Link</asp:LinkButton>
</EditItemTemplate>
        </asp:FormView>
    </ContentTemplate>
</asp:UpdatePanel>
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
<Windows>
        <telerik:RadWindow ID="MyDialogRadWindow" runat="server" Modal="True">
            <ContentTemplate>
                <asp:Label ID="MyLabel" runat="server" Text=""></asp:Label>
                <uc:MyControl ID="MySpecialControl" runat="server" />
                <asp:Button ID="DialogCancelButton" runat="server" Text="Cancel" OnClick="DialogCancelButton_Click"
                    Visible="false" />
                <asp:Button ID="DialogOkButton" runat="server" Text="Ok" OnClick="DialogOkButton_Click" />
            </ContentTemplate>
        </telerik:RadWindow>
</Windows>
</telerik:RadWindowManager>
</ContentTemplate>
</asp:UpdatePanel>

and my code behind for the linkbutton is

protected void MyLinkButton_Click(object sender, EventArgs e)
        {

// this was my attempts at the radalert

//                        string script = @"
//                                    function f() {
//                                        radalert('" + returnValues[1] + @"');                        
//                                    }
//                                Sys.Application.remove_load(f);
//                                Sys.Application.add_load(f);";

                       string script = @"radalert('" + returnValues[1] + @"',200,200);";                        
                        Page.ClientScript.RegisterStartupScript(typeof(string), "radalert", script, true);
}

i read various posts about this but there does not seem to be a definite method to open/show or close/hide the radwindow that is located inside of a updatepanel inside a user control.

I tried this and it does not work

        private void ShowDialog() 
        { 
         // define the name and type of the client scripts on the page 
            string csname = "showDialog"; 
            // get a clientscriptmanager reerence from the page class 
            ClientScriptManager cs = Page.ClientScript; 
            // check to see if the startup script is already registered 
            if (!cs.IsStartupScriptRegistered(csname)) 
            { 
                string script = @" 
                <script language='javascript'> 
                    function showDialog(){ 
                        var oWnd = $find('" + MyDialogRadWindow.ClientID + @"'); 
                        oWnd.show(); 
                        Sys.Application.remove_load(showDialog); 
                    };  
                    Sys.Application.add_load(showDialog); 
                </script>"; 
                cs.RegisterStartupScript(typeof(string), csname, script); 
            } 
        } 
 
        private void HideDialog() 
        { 
            string csname = "hideDialog"; 
            // get a clientscriptmanager reerence from the page class 
            ClientScriptManager cs = Page.ClientScript; 
            // check to see if the startup script is already registered 
            if (!cs.IsStartupScriptRegistered(csname)) 
            { 
                string script = @" 
                <script language='javascript'> 
                    function hideDialog(){ 
                        var oWnd = $find('" + MyDialogRadWindow.ClientID + @"'); 
                        oWnd.Close(); 
                        Sys.Application.remove_load(hideDialog); 
                    };  
                    Sys.Application.add_load(hideDialog); 
                </script>"; 
                cs.RegisterStartupScript(typeof(string), csname, script); 
            } 
        } 

i tried this but it did not help calling it server side

i tried doing the ajax sample here but that did not work either
how do I do this?
Fiko
Telerik team
 answered on 22 Jun 2010
1 answer
108 views
I have a grid with a bound column:

<telerik:GridBoundColumn HeaderText="<%$ Resources:Common, Load %>" DataField="LoadNo"

 

 

UniqueName="LoadNo" SortExpression="LoadNo" HeaderStyle-Width="30px" />


I make a javascript call to a web service and bind the results to the grid:

function

 

updateMCTGrid(result) {

 

 

try {

 

ShowHideLoadingPanel(

'Hide', MCTransferGrid.ClientID);

 

MCTransferGrid.get_masterTableView().set_dataSource(result.Data);

MCTransferGrid.get_masterTableView().dataBind();

MCTransferGrid.get_masterTableView().set_virtualItemCount(result.Count);

 

}

 

catch (e) {

 

ShowHideLoadingPanel(

'Hide', MCTransferGrid.ClientID);

 

}

}


The "LoadNo" is a number that can return 0.  When binding I see every non-zero value but, 0 show as blank in the column. 

Any thoughts?

 


 

 

Rosen
Telerik team
 answered on 22 Jun 2010
4 answers
473 views
Hello experts,
I have a rad grid with 5 groups each having certain number of items. I can sort the groups ascending or decending using sortexpression.
But my need is that, i want to reorder the groups so that the group which i prefer need to be the first one and the
rest may be in any order. simply to say, i want to set certain group to be the first one in the list of groups at runtime. 

Below is my GridView code, Please help on this its very urgent.

d
<telerik:RadGrid ID="GridView1" AllowSorting="true" runat="server" MasterTableView-GroupLoadMode="Client" GridLines="None" AutoGenerateColumns="False" Skin="Office2007" Width=100%> 
                                                                                             <groupingsettings casesensitive="False"  />      
                                                                                        <MasterTableView GroupsDefaultExpanded="false">                                                                                         
                                                                                            <GroupByExpressions> 
                                                                                                <telerik:GridGroupByExpression> 
                                                                                                    <SelectFields> 
                                                                                                        <telerik:GridGroupByField FieldAlias="Category" FieldName="Category" HeaderValueSeparator=" " HeaderText=" &lt;b&gt;Available : &lt;/b&gt;" FormatString="" ></telerik:GridGroupByField> 
                                                                                                    </SelectFields> 
                                                                                                     
                                                                                                    <GroupByFields> 
                                                                                                        <telerik:GridGroupByField FieldAlias="Category" FieldName="Category" FormatString="" SortOrder="None" HeaderText=""></telerik:GridGroupByField> 
                                                                                                    </GroupByFields> 
                                                                                                </telerik:GridGroupByExpression> 
                                                                                            </GroupByExpressions>                                                                                                                                                                              
                                                                                             
                                                                                         
                                                                                            <RowIndicatorColumn> 
                                                                                                <HeaderStyle Width="20px" /> 
                                                                                            </RowIndicatorColumn> 
                                                                                            <ExpandCollapseColumn > 
                                                                                                <HeaderStyle Width="20px" /> 
                                                                                            </ExpandCollapseColumn> 
                                                                                            <Columns> 
                                                                                                <telerik:GridTemplateColumn  UniqueName="TemplateColumn1" HeaderText="&lt;font color=red&gt; Select&lt;/font&gt;"> 
                                                                                                <ItemTemplate> 
                                                                                                <asp:CheckBox ID="CheckBox1" AutoPostBack="true" runat="server"/> 
                                                                                                </ItemTemplate> 
                                                                                                    <ItemStyle HorizontalAlign="Left" /> 
                                                                                                </telerik:GridTemplateColumn> 
                                                                                                <telerik:GridTemplateColumn HeaderText="Product" UniqueName="URL"> 
                                                                                                <ItemTemplate> 
                                                                                                   <a href=<%# Eval("URL") %> target="_blank" ><%# Eval("Product_Name")%></a> 
                                                                                                 
                                                                                                </ItemTemplate> 
                                                                                                </telerik:GridTemplateColumn>                                                                                                 
                                                                                                                                                                                               
                                                                                                <telerik:GridBoundColumn EmptyDataText="&amp;nbsp;" HeaderText="Product" UniqueName="Product_Name" DataField="Product_Name" Visible=False > 
                                                                                                    <ItemStyle HorizontalAlign="Left" /> 
                                                                                                </telerik:GridBoundColumn> 
                                                                                                <telerik:GridBoundColumn EmptyDataText="&amp;nbsp;" HeaderText="Date" UniqueName="Date" DataField="Date"> 
                                                                                                </telerik:GridBoundColumn> 
                                                                                                <telerik:GridBoundColumn DataField="Resolution" EmptyDataText="&amp;nbsp;" HeaderText="Resolution" 
                                                                                                    UniqueName="Resolution"> 
                                                                                                    <ItemStyle HorizontalAlign="Left" /> 
                                                                                                </telerik:GridBoundColumn> 
                                                                                                <telerik:GridBoundColumn DataField="Percentage_Coverage" EmptyDataText="&amp;nbsp;" 
                                                                                                    HeaderText="% Coverage" UniqueName="Percentage_Coverage"> 
                                                                                                    <ItemStyle HorizontalAlign="Left" /> 
                                                                                                </telerik:GridBoundColumn> 
                                                                                                <telerik:GridBoundColumn DataField="Price" EmptyDataText="&amp;nbsp;" HeaderText="Price ($)" 
                                                                                                    UniqueName="Total_Price"> 
                                                                                                    <ItemStyle HorizontalAlign="Left" /> 
                                                                                                </telerik:GridBoundColumn> 
                                                                                                <telerik:GridBoundColumn DataField="Area" EmptyDataText="&amp;nbsp;" HeaderText="Area" 
                                                                                                    UniqueName="Price" Visible="False"> 
                                                                                                </telerik:GridBoundColumn> 
                                                                                                <telerik:GridTemplateColumn UniqueName="ViewScene"> 
                                                                                                <ItemTemplate> 
                                                                                                   <a href="javascript:openScenePopup('<%# Eval("SubProduct") %>','<%# Eval("AOI") %>','<%# Eval("View_Scene") %>')"><%# Eval("View_Scene") %></a> 
                                                                                                 
                                                                                                </ItemTemplate> 
                                                                                                    <ItemStyle HorizontalAlign="Left" /> 
                                                                                                </telerik:GridTemplateColumn> 
                                                                                                 
                                                                                                                                                                                           
                                                                                                 
                                                                                                 
                                                                                                 
                                                                                                <telerik:GridBoundColumn DataField="SubProduct" EmptyDataText="&amp;nbsp;" HeaderText="SubProduct" 
                                                                                                    UniqueName="SubProduct" Visible="False"> 
                                                                                                </telerik:GridBoundColumn> 
                                                                                                <telerik:GridBoundColumn DataField="Notes" EmptyDataText="&amp;nbsp;" HeaderText="Notes" 
                                                                                                    UniqueName="Notes" Visible="False"> 
                                                                                                </telerik:GridBoundColumn> 
                                                                                                <telerik:GridBoundColumn DataField="Category" EmptyDataText="&amp;nbsp;" HeaderText="Category" 
                                                                                                    UniqueName="Category" Visible="False"> 
                                                                                                </telerik:GridBoundColumn> 
                                                                                                 
                                                                                                <telerik:GridTemplateColumn HeaderText="Recommended" UniqueName="Recommended"> 
                                                                                                <ItemTemplate> 
                                                                                                   <img src=<%# Eval("Recommended")%> width=18 height=18 alt="Recommendation is based on your total Area"> 
                                                                                                 
                                                                                                </ItemTemplate> 
                                                                                                 <ItemStyle HorizontalAlign="Center"  /> 
                                                                                                </telerik:GridTemplateColumn> 
                                                                                                <telerik:GridBoundColumn DataField="EULA" EmptyDataText="&amp;nbsp;" UniqueName="EULA" Visible="False"> 
                                                                                                </telerik:GridBoundColumn> 
                                                                                            </Columns> 
                                                                                             
                                                                                        </MasterTableView> 
                                                                                        <FilterMenu EnableTheming="True" Skin="WebBlue"> 
                                                                                            <CollapseAnimation Duration="200" Type="OutQuint" /> 
                                                                                        </FilterMenu> 
                                                                                        <GroupPanel Text=""> 
                                                                                        </GroupPanel> 
                                                                                    </telerik:RadGrid> 
Mukunda
Top achievements
Rank 1
 answered on 22 Jun 2010
2 answers
140 views
Hi,

I am developing an application for my client (they have a license for Asp.net AJAX components) and we need to use the listview.
The current version that we have is this:
<add assembly="Telerik.Web.UI, Version=2009.2.826.20,Culture=neutral, PublicKeyToken=121fae78165ba3d4" />

A few questions: 
  1. Is the listview control part of the version that we have bought? If yes, how can we add it to the toolbox?
  2. If it is not part of our version, can we upgrade to the latest version for free? Please give us a link for that.

Thanks
Vishesh
vishesh kumar
Top achievements
Rank 1
 answered on 22 Jun 2010
1 answer
130 views

Hi Support,

I've been using the Radgrid component for some time now and have stumble into a problem I can't resolve.

I have a hierarchical grid which I want paging inside the details table. I've used a simple data binding in the server code:

RadGrid2.DataSource = DataTable1;

RadGrid2.MasterTableView.DetailTables[0].DataSource = DataTable2;

And simple relations in the aspx file:

                        <ParentTableRelation>

                            <telerik:GridRelationFields

                                            DetailKeyField="IDPerek"

                                            MasterKeyField="IDPerek" />

                        </ParentTableRelation>

 

 

The problem we are facing is that in the details table it seems that we have paging that is not in relation to a level but to the entire data source – so in each level we have the same number of pages although the number of records is different.
In the example below (see file attached) you can see the problem – the number in brackets show the actual number of records in each level:

Note: the characters are in Hebrew and the grid is right to left aligned.

Any help will be appreciated,
Evgeny

Pavlina
Telerik team
 answered on 22 Jun 2010
1 answer
99 views
Hi,

We have a requirement where we want the sorting, Filtering to work on RadGrid when javascript is disabled to make it 508 compliant.

Any help is much appreciated.
Pavlina
Telerik team
 answered on 22 Jun 2010
3 answers
119 views
How can I disable RadChart from rendering a style, the javascript onerror call, and the additional script block.  I want to simply show a RadChart that does not involve any further user interaction nor postbacks.

For example, here's what my RadChart outputs:
<div id="ctl04_BarCharts_ctrl1_BarChart" class=" RadChart" style="height:44px;width:293px;"> 
    <img alt='' style='border-width: 0px;'  src='ChartImage.axd?UseSession=true&amp;ChartID=530d344a-c0c1-408c-b083-88a56c512866_chart_ctl04$BarCharts$ctrl1$BarChart&amp;imageFormat=Png&amp;random=0.0234165825058783' onerror="if(confirm('Error loading RadChart image.\nYou may also wish to check the ASP.NET Trace for further details.\nDisplay stack trace?'))window.location.href=this.src;" /><input id="ctl04_BarCharts_ctrl1_BarChart_ClientState" name="ctl04_BarCharts_ctrl1_BarChart_ClientState" type="hidden" /> 
</div><script type="text/javascript"> 
//<![CDATA[ 
    Sys.Application.add_init(function(){});
//]]> 
</script> 
 


and here's what I'd like it to output:
<div id="ctl04_BarCharts_ctrl1_BarChart" class=" RadChart"> 
    <img alt='' src='ChartImage.axd?UseSession=true&amp;ChartID=530d344a-c0c1-408c-b083-88a56c512866_chart_ctl04$BarCharts$ctrl1$BarChart&amp;imageFormat=Png&amp;random=0.0234165825058783' /> 
</div>

or better yet:
    <img alt='' src='ChartImage.axd?UseSession=true&amp;ChartID=530d344a-c0c1-408c-b083-88a56c512866_chart_ctl04$BarCharts$ctrl1$BarChart&amp;imageFormat=Png&amp;random=0.0234165825058783' />  



Vladimir Milev
Telerik team
 answered on 22 Jun 2010
1 answer
139 views
Some Q I have been wonder, is there a way with skinmanager to have a separate skin (or simple CSS file) for the media=print?
I guess this would be a quite common request?

And are there a way to add special CSS fiels for a particular browser, for example a IE8.css ?
Dimo
Telerik team
 answered on 22 Jun 2010
1 answer
67 views
Hi all,

I have a case using RadGrid. After we click Add New Record link in the RadGrid. There is a new detail row appear in the grid. We can collapse the edit row but not for new row.
Is there a way to remove the new detail row from code behind? If any, please show me how to do it.

Thanks,
Pavlina
Telerik team
 answered on 22 Jun 2010
1 answer
93 views
On postback in the codebehind. How can i find the url or filename of the file or files selected.
The fileexplorer dont seem to have such a property. I also tried looking in the grid and treeview of the explorer.

Thanks, Lautaro.
Petio Petkov
Telerik team
 answered on 22 Jun 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?