Telerik Forums
UI for ASP.NET AJAX Forum
8 answers
535 views
I have the following code. When clicked on the pencil icon, edit form appears. How to get the value of the Details Table Column into the code behind. Which event(UpdateCommand??) should i use in the code behind?


<
MasterTableView Width="100%" DataKeyNames="ModId" AllowMultiColumnSorting="True" HeaderStyle-Font-Size="14px" HeaderStyle-Font-Bold="true" >                               
<DetailTables>
  <telerik:GridTableView DataKeyNames="ModId" AutoGenerateColumns="false" Width="100%" HeaderStyle-Font-Size="12px" HeaderStyle-Font-Bold="true" HeaderStyle-BackColor="#c0c0c0" AlternatingItemStyle-BackColor="#cccccc" >
  <ParentTableRelation>
  <telerik:GridRelationFields DetailKeyField="ModId" MasterKeyField="ModId" />
                                                                                    </ParentTableRelation>                                        
  <Columns>
    <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn1">
    <HeaderStyle Width="20px" />
    <ItemStyle CssClass="MyImageButton" />
    </telerik:GridEditCommandColumn>
    <telerik:GridBoundColumn SortExpression="IssuedDate" HeaderText="Issued Date" readonly="true" DataField="IssuedDate" ItemStyle-Width="200px">
    </telerik:GridBoundColumn>
Peter
Top achievements
Rank 1
 answered on 08 Jan 2015
5 answers
275 views
I have a JavaScript function that calls mastertable.fireCommand("RebindGrid") on several grids in that main function; however, when the function is called some of the grids refresh (rebind) and some do not?

Code:

function CloseAndRefresh () {

var masterTable1 = $find("<%= radGrid1.ClientID %>").get_masterTableView();
var masterTable2 = $find("<%= radGrid2.ClientID %>").get_masterTableView();

masterTable1.fireCommand("RebindGrid");
masterTable2.fireCommand("RebindGrid");

}

Now, here the radGrid2 data appears to be updated; however, the radGrid1 retains the same data and does not appear to update. One note is that my CloseAndRefresh() function is being called from a RadWindow OnClientClose javascript call. Now, in the RadWindow I am changing the edited item to go from one grid to the other.

Please help!


Steve Holdorf
Michael
Top achievements
Rank 1
 answered on 07 Jan 2015
2 answers
264 views
I am using an object data source to filter, sort and use custom paging.  The only problem I am having is with the filter for a data/time field.  The data access code called by the object datasource control for the rad grid returns data and a row count 44.  However, no data is displayed in the grid. 

This problem does not make any sense to me.  If the data access code returns rows, the rows should display in the grid.  Data displays when I filter on any row but the data time field.  What could be causing this problem?  I have never worked with filtering a date time field in a rad grid before.
Phillip
Top achievements
Rank 1
 answered on 07 Jan 2015
2 answers
363 views
I am using the current version of the Telerik UI dll (version 2014.1.225.45)
This is the definition of my RadEditor on my page:


The problem I am having is that when I save the content OR switch to "Design" view and back to the "HTML" view, it is stripping my <body></body> and <html></html> tags

What I want is for the editor to not mess with what I enter in any way.  I thought I had specified this in the definition of the editor on the page.  What properties do I have to set so that the editor does not change anything?

 
<telerik:RadEditor ID="reContent" runat="server" Skin="Office2010Blue" Height="850px" Width="100%" StripFormattingOptions="MSWordRemoveAll"<br>                                ContentAreaMode="Div" EmptyMessage="Add Content Here - Content is Required" StripFormattingOnPaste="MSWordRemoveAll"<br>                                ClientIDMode="Static" NewLineMode="Br" OnClientLoad="OnClientLoad" AllowScripts="true" ContentFilters="None"><br>                            </telerik:RadEditor>


Thanks,
Jim
Jim
Top achievements
Rank 1
 answered on 07 Jan 2015
7 answers
195 views
I just noticed something strange while I was testing for an unrelated issue.

I have a RadTreeView that loads content into a RadTabStrip/Mulitpage. In one of the tabs I have a RadUpload control. The tree and the tabstrip are Ajaxified.

When I click on a node in the TreeView it loads the relevant content in the tabs. However, I have just noticed while monitoring my application with Fiddler that after the inital load I get multiple (infinite?) calls to: http://servername:8070/Telerik.RadUploadProgressHandler.ashx?RadUrid=784e5751-9181-4e49-bb82-44cd26a3f791&RadUploadTimeStamp=1281621267773&

These keep on going until I kill the browser. At the point in which this is happening no file has been selected for upload. The upload tab isn't even visible at this point.

Have I set my RadUpload up incorrectly? Why is this happening?

Thanks,
Scott.
Hristo Valyavicharski
Telerik team
 answered on 07 Jan 2015
3 answers
107 views
 I have an independent Radpager in my page with no grid or listview. I have an asp placeholder inside the fields of this pager which all the linkbuttons (numbers) will be added to this placeholder dynamically. I want to add the PageButtonCount to this placeholder to prevent increasing the with of raddatapager. becaz now each linkbutton is being added to the placeHolder and causes that to show all numbers. Please help me asap. I need to hide some of those pages like the PageButtonCount in this placeholder.


<telerik:RadDataPager ID="RadDataPager1" runat="server" >                            
     <Fields>                                           
 <asp:ImageButtonID="prev"ImageUrl="previous.jpg"/> 
<asp:PlaceHolderID="Placeholder1" runat="server"/>  
<asp:ImageButtonID="Next"ImageUrl="Next.jpg"/>                                             <                                    </Fields>                                    </telerik:RadDataPager>
Daniel
Telerik team
 answered on 07 Jan 2015
1 answer
279 views
I have a RadDataForm:
 
        <telerik:RadDataForm runat="server" ID="RadDataForm1"
            DataKeyNames="IdCompra"
            DataSourceID="dsCompraDivisasEncabezado"
            Skin="Windows7"
            OnDataBound="RadDataForm1_DataBound"
            OnItemInserting="RadDataForm1_ItemInserting"
        >

            <EditItemTemplate>
                <fieldset class="rdfFieldset rdfBorders" style="width:550px;">
                    <legend class="rdfLegend">Compra de Divisas</legend>
                    <div class="rdfRow">
                        <asp:Label ID="lblIdCompania" runat="server" CssClass="rdfLabel rdfBlock" Text="Id Compañia:"></asp:Label>
                        <telerik:RadComboBox runat="server" ID="rcbCompania" 
                            DataSourceID="dsCompanias" 
                            DataTextField="CompaniaDescripcion"
                            DataValueField="IdCompania" 
                            AutoPostBack="true"
                            OnSelectedIndexChanged="rcbCompania_SelectedIndexChanged">
                        </telerik:RadComboBox>
                    </div>

                    <div class="rdfRow">
                        <asp:Label ID="lblIdPlanta" runat="server" CssClass="rdfLabel rdfBlock" Text="Planta:"></asp:Label>
                        <asp:Label ID="lblIdPlantaValor" runat="server" CssClass="rdfFieldValue" Text='<%# String.Concat(Eval("IdPlanta"), " - ",Eval("PlantaDescripcion"))%>' />
                    </div>
                </fieldset>
            </EditItemTemplate>

            <InsertItemTemplate>
                <fieldset class="rdfFieldset rdfBorders" style="width:550px;">
                    <legend class="rdfLegend">Compra de Divisas</legend>
                    <div class="rdfRow">
                        <asp:Label ID="lblIdCompania" runat="server" CssClass="rdfLabel rdfBlock" Text="Id Compañia:"></asp:Label>
                        <telerik:RadComboBox runat="server" ID="rcbCompania" 
                            DataSourceID="dsCompanias" 
                            DataTextField="CompaniaDescripcion"
                            DataValueField="IdCompania" 
                            AutoPostBack="true"
                            OnSelectedIndexChanged="rcbCompania_SelectedIndexChanged">
                        </telerik:RadComboBox>
                    </div>

                    <div class="rdfRow">
                        <asp:Label ID="lblIdPlanta" runat="server" CssClass="rdfLabel rdfBlock" Text="Planta:"></asp:Label>
                        <asp:Label ID="lblIdPlantaValor" runat="server" CssClass="rdfFieldValue" Text='<%# String.Concat(Eval("IdPlanta"), " - ",Eval("PlantaDescripcion"))%>' />
                    </div>
                </fieldset>
            </InsertItemTemplate>

The next procedure works when RadDataForm is in edit mode:

protected void rcbCompania_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)

        {
            RadComboBox rcbCompania = (RadComboBox)sender;
            Label lblIdPlantaValor = (Label)RadDataForm1.Items[0].FindControl("lblIdPlantaValor");

            string strMensaje = "";
            DataTable dtCompania = CompaniaConsulta("Divisas", "ID", rcbCompania.SelectedValue, out strMensaje);

            lblIdPlantaValor.Text = dtCompania.Rows[0]["IdPlanta"].ToString() + "-" + dtCompania.Rows[0]["PlantaDescripcion"].ToString();
        } but when it is in Insert mode it says: RadDataForm1.Items.Count = 0.  How can i find the control?






Konstantin Dikov
Telerik team
 answered on 07 Jan 2015
1 answer
43 views
Hello,

I am having an issue where i am using the modal style editing for my grid.

For update and delete i am using a linkbutton column which is properly bringing up the modal and will close any existing modal before that. However if the new record modal is already up, that one will not get closed by the edit/delete linkbutton.

The new record button does however close an existing edit/delete modal.

On grid_ItemCommand am i doing a grid.MasterTableView.ClearEditItems for all three commands, and it does indeed take the grid out of edit mode, however the modal doesn't close for the edit and delete commands.

Any ideas ?

Thanks,

Max T.
Viktor Tachev
Telerik team
 answered on 07 Jan 2015
1 answer
82 views
I have discovered that the solution offered for moving a custom dialog box from its' automatically centered position does not work.

Well, it does work, but when you successfully complete the dialog box (i.e. hitting a submit button), the RadWindow dialog reappears with no rhyme or reason and, furthermore, you can't close it or click any of the buttons.

...
<body>
    <form id="form1" runat="server">
    <table>
...
        <tr id="trFileName" runat="server">
            <td><asp:Label ID="lblFile" runat="server">File name:</asp:Label></td>
            <td><asp:FileUpload ID="txtFileName" runat="server" EnableViewState="true"></asp:FileUpload></td>
        </tr>
...
    </table>
 
    <asp:TextBox ID="txtOldFile" runat="server" style="display:none;" />
    <asp:Button ID="btnSubmit" runat="server" Text="Update" OnClientClick="insertLink();" />
  
    <script type="text/javascript">
        if (window.attachEvent) {
            window.attachEvent("onload", initDialog);
        }
        else if (window.addEventListener) {
            window.addEventListener("load", initDialog, false);
        }
 
        var workLink = null;
 
        function getRadWindow() {
            if (window.radWindow) {
                return window.radWindow;
            }
            if (window.frameElement && window.frameElement.radWindow) {
                return window.frameElement.radWindow;
            }
            return null;
        }
 
        function initDialog() {
            var clientParameters = getRadWindow().ClientParameters; //return the arguments supplied from the parent page
            getRadWindow().moveTo(50, 50); // <----- Commenting this line does not result in the window reappearing.
            //window.removeEventListener("load", initDialog, false); // <---- Tried this with no change in behavior.
            workLink = clientParameters;
        }
 
        function insertLink() //fires when the Insert Link button is clicked
        {
            //create an object and set some custom properties to it     
            var file = document.getElementById("<%=txtFileName.ClientID%>");
            var path = file.value;
            var ext = path.substring(path.lastIndexOf(".") + 1, path.length).toLowerCase();
 
            if (ext == null || ext == "") {
                workLink.href = document.getElementById("<%=txtOldFile.ClientID%>").value;
            } else {
                workLink.href = ext;
            }
 
            getRadWindow().close(workLink); //use the close function of the getRadWindow to close the dialog and pass the arguments from the dialog to the callback function on the main page.
        }
    </script>
  
    </form>
</body>
</html>

I'm guessing this KB was published quite a long time ago and has changed in future releases of Telerik AJAX.  Can you tell me if there's a way for me to fix this dilemma?  I have to move the dialog because I have a footer where the dialog hides under if the browser window is too small.

Thanks again!
Ianko
Telerik team
 answered on 07 Jan 2015
4 answers
99 views
Hi,

I have a set of 3 line series on my chart which is databound using a datatable. This works well and I have the 3 line series displayed as expected. 

What I'm trying to do now is to introduce new columns in my datatable which will inform if a given point in a series is special, in which case I want to highlight it (i.e. change the color of that point). I was thinking I can achieve this by adjusting the color while looping through SeriesItems. However, SeriesItems is empty.

Right after binding, I inspect the series and I see 3 series as expected. But when I inspect the SeriesItems (or Items), they are empty.

Both object below are empty after binding, yet the chart displays fine.
Chart.PlotArea.Series[0].Items

(Chart.PlotArea.Series[0] as LineSeries).SeriesItems

Any ideas?

Thanks,
A

Danail Vasilev
Telerik team
 answered on 07 Jan 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?