Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
1.5K+ views
All,

I have seen this issue reported by other people, but I have never had an issue. Now, it seems, I do. I've tried just about everything I know to resolve it, but while I find the gird on the page, the method get_masterTableView() always returns null.

My scenario involves my wanting to asynchronously load many grids on a page. Loading them normally has been pretty slow, so I am looking at faster ways to get the page up. As grid data populates, the grid shows up. Here is one of my Grid definitions:

<telerik:RadGrid ID="MyAnimalCategories" runat="server" AllowPaging="True" AllowSorting="True"
                   AutoGenerateColumns="False" AutoGenerateEditColumn="False" CellSpacing="0" GridLines="None"
                   OnNeedDataSource="MyAnimalCategoriesNeedDataSource" PageSize="20" OnSelectedIndexChanged="MyAnimalCategoriesSelectedIndexChanged">
                    <ClientSettings EnablePostBackOnRowClick="true">                                   
                       <Selecting AllowRowSelect="true" />
                       <ClientEvents OnRowSelected="SetDeviceText" OnCommand="function(){}" />
                   </ClientSettings>
                   <MasterTableView ShowHeadersWhenNoRecords="true" ClientDataKeyNames="AnimalCategoryId" DataKeyNames="AnimalCategoryId"  TableLayout="Fixed">
                       <Columns>
                           <telerik:GridBoundColumn DataField="AnimalCategoryName" HeaderText="Animal Species" UniqueName="Category">
                               <ItemStyle Wrap="false" />
                               <HeaderStyle Wrap="false" />
                           </telerik:GridBoundColumn>
                           <telerik:GridTemplateColumn ItemStyle-Width="50px" AllowFiltering="false" ReadOnly="true"
                               HeaderText="Status">
                               <ItemTemplate>
                                   <%# Convert.ToBoolean(Eval("IsActive").ToString())? "Active":"Inactive" %>
                               </ItemTemplate>
                           </telerik:GridTemplateColumn>
                       </Columns>
                   </MasterTableView>
               </telerik:RadGrid>

Here is the script
<telerik:RadCodeBlock runat="server" ID="RadCodeBlock1">
        <script type="text/javascript">
 
            function pageLoad(src, args) {
                var trainer = $('#<%= hdnTrainer.ClientID %>');
                var trainerId = trainer.val();
 
                PageMethod("LoadMySpecies", ["trainerId", trainerId], MySpecies, AjaxFailed);
                PageMethod("LoadMySubmissions", [], MySubmissions, AjaxFailed);
            }
 
            function PageMethod(fn, paramArray, successFn, errorFn) {
                var pagePath = window.location.pathname;
                //Create list of parameters in the form : {"paramName1":"paramValue1","paramName2":"paramValue2"}
                var paramList = '';
                if (paramArray.length > 0) {
                    for (var i = 0; i < paramArray.length; i += 2) {
                        if (paramList.length > 0)
                            paramList += ',';
                        paramList += '"' + paramArray[i] + '":"' + paramArray[i + 1] + '"';
                    }
                }
                paramList = '{' + paramList + '}';
 
                //Call the page method
                $.ajax({
                    type: "POST",
                    url: pagePath + "/" + fn,
                    contentType: "application/json; charset=utf-8",
                    data: paramList,
                    dataType: "json",
                    success: successFn,
                    error: errorFn
                });
            }
 
            function MySubmissions(result) {
                var grid =  $find("<%= MySubmissions.ClientID %>");
                var masterTable = grid.get_masterTableView();
                var data = eval(result.d);
 
                masterTable.set_dataSource(data);
                masterTable.dataBind();
            }
 
            function MySpecies(result) {
                var grid = $find('<%= MyAnimalCategories.ClientID %>');
                var masterTable = grid.get_masterTableView();
                var data = eval(result.d);
                masterTable.set_dataSource(data);
                masterTable.dataBind();
            }
 
            function AjaxFailed(result) {
                alert(result.statusText);
            }
        </script>
</telerik:RadCodeBlock>


The script, as I said, finds the grid just fine, but the methods in the object do not include the get_masterTableView().

Thanks for any insight!

Sean~

Robin
Top achievements
Rank 1
 answered on 11 Dec 2014
4 answers
237 views
Hi all,

I have a grid with editMode inPlace. When the user adds a new row and clicks "insert" then I can not manage to get the entered values.

Would you please help me with this? What am I missing?!

ASCX code:

<telerik:RadGrid ID="RadGrid1" runat="server" GridLines="None" MasterTableView-EditMode="InPlace"   
    AutoGenerateColumns="False" Height="150px" oninsertcommand="RadGrid1_InsertCommand" >
<MasterTableView CommandItemDisplay="Top" InsertItemDisplay="Bottom" ShowHeadersWhenNoRecords="true" >
<CommandItemTemplate>
<telerik:RadToolBar ID="rdtbTravelTimeRecording" Runat="server" style="display: block; float: none;
    width: 100%" OnButtonClick="rdtbTravelTimeRecording_ButtonClick"  OnClientButtonClicking="onClientButtonClicking">
    <items>
        <telerik:RadToolBarButton runat="server" Text="Speichern" CommandName="Save" ImageUrl="../../images/icons/Save.png" Width="120px" meta:resourcekey="RadToolBarButtonResource1">
        </telerik:RadToolBarButton>
        <telerik:RadToolBarButton runat="server" Text="Zur Genehmigung" CommandName="Approval" ImageUrl="../../images/icons/Clipboard Check.png" Width="120px" meta:resourcekey="RadToolBarButtonResource1">
        </telerik:RadToolBarButton>
        <telerik:RadToolBarButton runat="server" Text="Zeile hinzuf&uuml;gen" CommandName="InitInsert" ImageUrl="../../images/icons/SymbolAdd.png" Width="120px" meta:resourcekey="RadToolBarButtonResource2">
        </telerik:RadToolBarButton>
    </items>
</telerik:RadToolBar>

</CommandItemTemplate>
    <Columns>
    <telerik:GridTemplateColumn  HeaderText="Datum" uniquename="column4">
        <ItemTemplate>
            <asp:Label ID="typeText" Text='<%# Eval("Date") %>' runat="server" ></asp:Label>
        </ItemTemplate>
        <EditItemTemplate>
            <telerik:RadDatePicker DataField="Date" PickerType="DatePicker" ID="Date" Runat="server"></telerik:RadDatePicker>
        </EditItemTemplate>
    </telerik:GridTemplateColumn>
    
    <telerik:GridTemplateColumn  HeaderText="Von" uniquename="column4">
        <ItemTemplate>
            <asp:Label ID="typeText" Text='<%# Eval("BeginTime") %>' runat="server" ></asp:Label>
        </ItemTemplate>
        <EditItemTemplate>
            <telerik:RadTimePicker DataField="BeginTime" PickerType="TimePicker" ID="PickerFrom" Runat="server"></telerik:RadTimePicker>
        </EditItemTemplate>
    </telerik:GridTemplateColumn>
    
    <telerik:GridTemplateColumn  HeaderText="Bis" uniquename="column4">
        <ItemTemplate>
            <asp:Label ID="typeText" Text='<%# Eval("EndTime") %>' runat="server" ></asp:Label>
        </ItemTemplate>
        <EditItemTemplate>
            <telerik:RadTimePicker  DataField="EndTime" PickerType="TimePicker" ID="PickerTo" Runat="server"></telerik:RadTimePicker>
        </EditItemTemplate>
    </telerik:GridTemplateColumn>
    
    <telerik:GridTemplateColumn  HeaderText="Anwesenheitsart" uniquename="column4">
        <ItemTemplate>
            <asp:Label ID="typeText" Text="Test" runat="server" ></asp:Label>
        </ItemTemplate>
        <EditItemTemplate>
            <telerik:RadComboBox ID="rdcbReason" Runat="server"></telerik:RadComboBox>
        </EditItemTemplate>
    </telerik:GridTemplateColumn>
    
    <telerik:GridTemplateColumn HeaderText="Reiseort/Reisegrund" uniquename="TemplateColumn">
    
        <ItemTemplate>
            <asp:Label ID="typeText" Text='<%# Eval("Type") %>' runat="server" ></asp:Label>
        </ItemTemplate>
        
        <EditItemTemplate>
            <telerik:RadTextBox Width="250px" ID="TextBox1" Runat="server"></telerik:RadTextBox>
        </EditItemTemplate>
    
    </telerik:GridTemplateColumn>
    
    <telerik:GridEditCommandColumn ItemStyle-Width="100px" UniqueName="EditColumn" EditText="Bearbeiten" InsertText="Einf&uuml;gen" CancelText="Abbrechen" UpdateText="Aktualisieren" ></telerik:GridEditCommandColumn>
    <telerik:GridButtonColumn ItemStyle-Width="100px" commandname="Delete" text="L&ouml;schen" uniquename="DeleteColumn"></telerik:GridButtonColumn>
    </Columns>
</MasterTableView>
</telerik:RadGrid>

//Here is what I tried in code behind:
protected void RadGrid1_InsertCommand(object source, GridCommandEventArgs e)
        {
            GridDataInsertItem ii;
            ii = (GridDataInsertItem)RadGrid1.MasterTableView.GetInsertItem();
            
            RadDatePicker date;
            RadDateTimePicker rdtpFrom;
            RadDateTimePicker rdtpTo;
            RadComboBox rdcbReason;

            date = (RadDatePicker)ii.FindControl("Date");
            rdtpFrom = (RadDateTimePicker)ii.FindControl("PickerFrom");
            rdtpTo = (RadDateTimePicker)ii.FindControl("PickerTo");
            rdcbReason = (RadComboBox)ii.FindControl("rdcbReason"); 

            DataRow dr = dt2.NewRow();
            dr["Date"] = date.SelectedDate.ToString();
            dr["BeginTime"] = rdtpFrom.TimeView.StartTime.ToString();
            dr["EndTime"] = rdtpFrom.TimeView.EndTime.ToString();
            dr["Type"] = rdcbReason.Text;
            dt2.Rows.Add(dr);

            RadGrid1.DataSource = dt2;
            RadGrid1.DataBind();
        }


//Thank you very much!
hamid
Top achievements
Rank 1
 answered on 11 Dec 2014
1 answer
93 views
I haven't been successful getting AsyncUpload to work from VS2013.  Is there a complete VS project I can download that shows how to upload a file from a web page?  Thanks
Hristo Valyavicharski
Telerik team
 answered on 11 Dec 2014
3 answers
388 views
Hey guys,

I have made a recommendation to Telerik on this one and I need support for this new control idea.  If you do find it useful, please submit it as a feature request for the cause.

Thanks in advance.
_________________________

I think a Digital Signature control would be a great add-on to the existing Telerik ASP.net library. 
Some of the main properties would include:
  • Integrated Authentication(Active Directory) vs. Anonymous mode
  • Text
  • Background image
  • the existing skin options
  • Fonts
  • and others

Client experience
  • When the Integrated Authentication is selected (during the development), the Current Context User ID is populated in the signature box along with DateTime
  • When the Anonymous mode is selected (during the development), the user will be able to enter Full Name inside a popup window and then control would be populated with the full name along with DateTime.
  • As soon as the control populated by the user, the signature can not be changed. (When the control renders on the client side, the signature would automatically be converted into a binary image which would be stored at a temporary folder.)

Server Side Capturing / Reading
Then the developer could use the usual binary conversion methods to send it to a database.  As soon as the Image is consumed it would be discraded from the temporary storage.

This is obviously a high level description on how I perceived it would work.  However, regardless of how it gets built or works from the developer perspective, if the main functionality I have mentioned here existed today it would definetely be one more thing for me to brag about Telerik to my colleges.

Best Regards,

Ian

 
Rumen
Telerik team
 answered on 11 Dec 2014
1 answer
120 views
grid is loading and when i am clicking on page numbers its working, but next precious button is not workng. and its not showing any error message also

Please help.

thanks,

please find the below code : 


design page :

<asp:ScriptManager ID="ScriptManager1" ScriptMode="Release" runat="server" EnablePageMethods="true">
                </asp:ScriptManager>
                <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                </telerik:RadAjaxManager>
                <telerik:RadGrid ID="telGrid" runat="server" AllowPaging="True" AllowSorting="True" PageSize="10"
                    AllowFilteringByColumn="True" OnPageIndexChanged="PhaseView_PageIndexChanged" OnNeedDataSource="PhaseView_NeedDataSource">
                    <MasterTableView AutoGenerateColumns="false" TableLayout="Fixed">
                        <Columns>
                            <telerik:GridBoundColumn DataField="DrugId" HeaderText="DrugId" UniqueName="DrugId">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="DDC_CODE" HeaderText="DDC_CODE" UniqueName="DDC_CODE">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="TRADE_NAME" HeaderText="TRADE_NAME" UniqueName="TRADE_NAME">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="STATUS" HeaderText="STATUS" UniqueName="STATUS">
                            </telerik:GridBoundColumn>
                        </Columns>
                    </MasterTableView>
                    <ClientSettings EnableRowHoverStyle="true" EnablePostBackOnRowClick="true">
                        <Selecting AllowRowSelect="true" EnableDragToSelectRows="false" />
                    </ClientSettings>
                </telerik:RadGrid>

code behind :

protected void PhaseView_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            loadgrid();
        }
        private void loadgrid()
        {
            DataTable dtDrug = new ClinicBLL.Settings.Settings_DrugBLL().GridLoad_FetchForUpdate();

            if (dtDrug != null && dtDrug.Rows.Count > 0)
            {
                telGrid.DataSource = dtDrug;
                telGrid.DataBind();
            }
        }


Pavlina
Telerik team
 answered on 11 Dec 2014
1 answer
380 views
Hi,
I need to create a confirm popup window after server side validation.
steps:
1- after click the button it should go to the serverside to validate value from database 
2- if (match) then confiramation popup 
     No --> cancel event
     yest --> to continue 
Marin Bratanov
Telerik team
 answered on 11 Dec 2014
3 answers
92 views

 

G'Day Guys,

I love the demos that you have posted, such as http://demos.telerik.com/aspnet-ajax/grid/examples/clientbinding/defaultcs.aspx and it is great that you have provided the source code.

You have also provided "Instructions how to isolate this demo as a stand-alone application (removing the Quick Start Framework dependencies)" which are easy enough to follow but very time consuming. Can you post the stand alone code as well? That way it only needs to be done once, rather than hundreds of us wasting our time going through the code and deleting out the Quick Start Framework dependencies. I know I would be more inclined to play with the code if I didn't have to spend half an hour on each example cleaning it up.

If you don't want to do it yourself then maybe provide an upload box where some good Samaritan can submit the code that they just spent half an hour cleaning, so that it doesn't have to be done by hundreds of others.

Just a thought.

Cheers

Ian.

Pavlina
Telerik team
 answered on 11 Dec 2014
2 answers
89 views
Hello,

Is there a way to preserve capitalized HTML tag in the telerik editor when switching from HTML mode to Design/Preview mode and back to HTML mode? Switching between editor modes always converting the HTML tag to lower case tag. Please see screen shots CaptureBefore.PNG (initial edits in HTML mode) and CaptureAfter.PNG (back to HTML mode from either Design or Preview mode). 
Ianko
Telerik team
 answered on 11 Dec 2014
3 answers
184 views
My need is to create the pivot grid programmatically and allow users to pivot the fields that they like. 

1) As soon as the data is bound to the pivot grid, it automatically creates some of the fields as RowPivotGrid and some as Aggregate etc. How to control this behavior? By the time _FieldCreated event is called, the field with Telerik's assumed type is already created. How can we override this behavior so that we check the field Name, Type etc and provide proper type for it?  (we tried to initialize fields by adding fields to Fields collection but they show up on the pivot grid, we are trying to control the "All Fields" in the panel)

2) Also for DateTime type of fields, Telerik automatically adds fields like "-Month", "-Week" etc - but while dragging them on to the grid, the month or week are not properly displayed and they don't have correct group interval either. 

Basically I am looking for the best place to gain access to the fields displayed in "All Fields" and setting them properly to Row/Column type so that when user drags them they only go to valid sections.

Thanks,
Angel Petrov
Telerik team
 answered on 11 Dec 2014
1 answer
52 views
1. Is it possible to remove the inner white border of the lightbox? I mean the one that surrounds an image.
2. Is it possible to adjust the opacity level of the backdrop? All I can find is it's either on or off according to whether the lightbox is modal or not.
Angel Petrov
Telerik team
 answered on 11 Dec 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
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?