Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
112 views
Hi:

I implemented a column that only has itemtemplate defined, this column can chage it's values using a custom javascript.  The problem is that I have a save button outside the grid that is in BATCH MODE, that when clicked it will call the function grid.get_batchEditingManager().saveChanges(grid.get_masterTableView());,  But since that column never changes to edittemplate the saveChanges function is not detecting the data change.  Is there a way to mark a row or a cell as edited at the client-side, so when I click the save button the BatchEditCommand event is called with the correct GridBatchEditingEventArgs containing the row(s) that were modified with my custom javascript.

Regards,
Kostadin
Telerik team
 answered on 25 Feb 2014
8 answers
905 views
Hi i want to show image in Radgrid(Prometheus)
i hav image url in database an i want to show image in every row to there respective image.

my query is simple.
how to show image in each row.

Thanks
Vinamra Bhatnagar

    protected void BtnSearch_Click(object sender, EventArgs e) 
    { 
        String query = "SELECT Student.RollNo, Student.Name, Student.Batch, Course.Name AS Course, University.Name AS University, Student.Gender, Student.Birth_Date, Student.EmailId, Student.Address, Student.City, Student.[State/Province], Student.[Zip/Postal Code], Student.[Country/Region], Student.[Mobile Phone], Student.[Web Page], Student.Photo FROM University INNER JOIN Student ON University.code = Student.UniversityCode INNER JOIN Course ON Student.CourseId = Course.Id "
        switch (RadComboBox1.SelectedIndex) 
        { 
            case 0: 
                SqlDataSource1.SelectCommand = query +"WHERE (Student.RollNo = '" + TbSearchBox.Text + "')"
                RadGrid1.DataBind(); 
                break
            case 1: 
                SqlDataSource1.SelectCommand = query + "WHERE (Student.Name LIKE '" + TbSearchBox.Text + "%')"
                RadGrid1.DataBind(); 
                break
            case 2: 
                SqlDataSource1.SelectCommand = query + "WHERE (Student.Batch = '" + TbSearchBox.Text + "')"
                RadGrid1.DataBind(); 
                break
             
        } 
    } 
 



Haider S
Top achievements
Rank 1
 answered on 25 Feb 2014
7 answers
250 views
Does anyone know the *right way to extend the client interface for a RadGrid?  In other words, how can i add additional functions, properties, and events to the client object you can get via $find()?


I tried to create a new control, derive from RadGrid, and implement the IScriptControl functions.  Since i didn't want to interfere with the existing virtual functions, i tried doing something like this:
    List<ScriptReference> lBaseRefs = (List<ScriptReference>)base.GetScriptReferences();
    lBaseRefs.Add(MyReferenceGoesHere);
    return lBaseRefs;

That part works fine, but the descriptors function will basically only pay attention to one or the other - so i either *just* get the RadGrid client interface, or my own - but never both.

Does anyone know how to do this?  I spent some time searching online (since this is really a generic problem, rather than a Telerik problem), but i only came up with one StackOverflow question that matched what i was trying to do (and it was unanswered).


* I mention "the right way", because i've got something that appears to work.  Because of the client even "OnGridCreated", i'm able to attach a function that will then extend the client object:

function ExtendGridFunctionality(sender, eventArgs) {
    $find(sender.get_id()).alertMe = function() { alert('hi!'); }
}
Antonio Stoilkov
Telerik team
 answered on 25 Feb 2014
0 answers
48 views

Microsoft have discontinued support for MOSS (see their official MOSS support lifecycle page) since October 2012. This means that Telerik no longer supports MOSS environments as well.

The Telerik product that was specifically designed for MOSS is RadEditor for MOSS and it is discontinued and it not supported. Its last version is  5.8.16 which is based on the Q2 2012 release of the Telerik UI for ASP.NET AJAX. More information on the matter is available in the RadEditor for MOSS (SharePoint 2007) Discontinued as of Q2 2012 blog post.

The last documentation available for MOSS 2007 is attached to this post.

Telerik Admin
Top achievements
Rank 1
Iron
 asked on 25 Feb 2014
0 answers
61 views

Microsoft have discontinued support for MOSS (see their official MOSS support lifecycle page) since October 2012. This means that Telerik no longer supports MOSS environments as well.

The Telerik product that was specifically designed for MOSS is RadEditor for MOSS and it is discontinued and it not supported. Its last version is  5.8.16 which is based on the Q2 2012 release of the Telerik UI for ASP.NET AJAX. More information on the matter is available in the RadEditor for MOSS (SharePoint 2007) Discontinued as of Q2 2012 blog post.

The last documentation available for MOSS 2007 is attached to this post.

Telerik Admin
Top achievements
Rank 1
Iron
 asked on 25 Feb 2014
0 answers
41 views

Microsoft have discontinued support for MOSS (see their official MOSS support lifecycle page) since October 2012. This means that Telerik no longer supports MOSS environments as well.

The Telerik product that was specifically designed for MOSS is RadEditor for MOSS and it is discontinued and it not supported. Its last version is  5.8.16 which is based on the Q2 2012 release of the Telerik UI for ASP.NET AJAX. More information on the matter is available in the RadEditor for MOSS (SharePoint 2007) Discontinued as of Q2 2012 blog post.

The last documentation available for MOSS 2007 is attached to this post.

Telerik Admin
Top achievements
Rank 1
Iron
 asked on 25 Feb 2014
5 answers
241 views
Hi,

I have a radgrid based on a view (two tables) using entity datasource. 
When MasterTableView has EditMode="Batch" I am trying to use RadGrid1_UpdateCommand to
update values

 

Protected Sub RadGrid1_UpdateCommand(sender As Object, e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.UpdateCommand

        Dim editableItem = (DirectCast(e.Item,GridEditableItem))

        Dim partId = DirectCast(editableItem.GetDataKeyValue("PartID"), String)

        Dim coeus As New RTClientEntities()

        Dim part = coeus.Parts.Where(Function(p) p.PartID = partId).FirstOrDefault()

        If part IsNot Nothing Then

                      editableItem.UpdateValues(part)
          
                      part.LastChangedBy = getUser()

                     coeus.SaveChanges()
      End If

 
End Sub

 

 

When this function executes, editableItem has old values and updates part with them.

I can see new values in
TryCast(e.CommandArgument, GridBatchEditingEventArgument).NewValues()

When I change EditMode="InPlace" , everything works just fine.

Is there something I can do to new values in batch edit mode?  
Angel Petrov
Telerik team
 answered on 25 Feb 2014
2 answers
451 views
I have databinded my gridview  from a particular linq statement which populates certain values from a table.

I need to show a different name when the gridview populates

for eg. instead of saying true(which it says in the database ) I need it to say Active.

I cannot change the database.

        protected void rgUsers_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                if (e.Row.Cells[0].Text == "false") 
                { 
                    e.Row.Cells[0].Text = "Inactive"; 
                }
                else
                    if (e.Row.Cells[0].Text == "true")
                    {
                        e.Row.Cells[0].Text = "Active";
                    }
            }
        }
    }
}
Shinu
Top achievements
Rank 2
 answered on 25 Feb 2014
5 answers
125 views
Hi ,

I want to add a menu  item to my radmenu.
Currently the menu is getting populated from a sitemap. i want to keep that as it is and add a new item to the menu.
I can NOT add the new menu item to sitemap as it is a div so i need to have it in a itemtemplate.

The new item would be say Language with some thing like-
 <telerik:RadMenuItem Text="Language">
              <Items>
                  <telerik:RadMenuItem>
                      <ItemTemplate>
                          <div>
                              English
                      <br />
                              French
                          </div>
                      </ItemTemplate>
                  </telerik:RadMenuItem>
              </Items>
          </telerik:RadMenuItem>


Could any one help me on this , how can we achieve this , with a small piece of sample code

Thanks 

Kate
Telerik team
 answered on 25 Feb 2014
3 answers
167 views

I have 2 grids, each pointing to a datatable. The second table has to be filtered based on the row selection of first grid, so when you click a row on the first grid, in its SelectedIndexChanged event, it filters the second table to a view, converts that to a table, sets it to the 2nd grid's DataSource, and rebinds it. Works fine.

Now when the user clicks a button, I update the data server-side and want to update both grids without a page refresh. After data update, back in javascript, I rebind the first grid via get_masterTableView().rebind(). It updates fine. I then rebind the second grid the same way, but it causes a page refresh. I've no idea why and it's messes up everything.

So I stopped rebinding the second grid in javascript and thought I'd select a row in javascript after the first grid's rebind via .set_selected(true). That works. However, it does not call the SelectedIndexChanged event on the server, which I need to properly update the second grid. So either...

1) I need get_masterTableView().rebind() on the second grid to not update the entire page like the first grid.
2) Or I need to call SelectedIndexChanged to trigger after I select it in javascript with .set_selected

What do you recommend? And how can it be done? Chunks of my code are below...




    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="grdPODetails">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="grdPODetails" />
                    <telerik:AjaxUpdatedControl ControlID="pnlChild" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="grdReceiving">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="pnlChild" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    



                        <telerik:RadGrid ID="grdPODetails" runat="server" AllowSorting="True" AutoGenerateColumns="False" GridLines="None">
                            <HeaderContextMenu EnableAutoScroll="True">
                            </HeaderContextMenu>

                            <ClientSettings EnablePostBackOnRowClick="true">
                                <Selecting AllowRowSelect="True" />
                            </ClientSettings>

                            <MasterTableView Caption="Purchase Order Detail Information" CommandItemDisplay="None"
                                    ClientDataKeyNames="PurchaseOrderDetailKey" DataKeyNames="PurchaseOrderDetailKey">
                                <CommandItemSettings ShowRefreshButton="False" />
                                <NoRecordsTemplate>
                                    No detail lines to display.
                                </NoRecordsTemplate>
                                <Columns>
                                    <telerik:GridBoundColumn DataField="ChartOfAccountNumber" HeaderText="Acct Number" UniqueName="ChartOfAccountNumber">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="PurchaseOrderDetailDescription" HeaderText="Description" UniqueName="PurchaseOrderDetailDescription">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Catalogue" HeaderText="Catalogue" UniqueName="Catalogue">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="CostCenterID" HeaderText="Cost Center" UniqueName="CostCenterID">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridNumericColumn DataField="PurchaseOrderDetailQuantity" HeaderText="Quantity"
                                        UniqueName="PurchaseOrderDetailQuantity" DataFormatString="{0:N4}" DataType="System.Double">
                                    </telerik:GridNumericColumn>
                                    <telerik:GridNumericColumn DataField="UnitPrice" HeaderText="Unit Price" UniqueName="UnitPrice"
                                        DataFormatString="{0:N4}" DataType="System.Double">
                                    </telerik:GridNumericColumn>
                                    <telerik:GridBoundColumn DataField="UnitDescription" HeaderText="Unit Desc" UniqueName="UnitDescription">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridNumericColumn DataField="PurchaseOrderDetailAmount" HeaderText="Amount"
                                        UniqueName="PurchaseOrderDetailAmount" DataFormatString="{0:N2}" DataType="System.Double">
                                    </telerik:GridNumericColumn>
                                    <telerik:GridNumericColumn DataField="PurchaseOrderDetailBalance" HeaderText="Balance"
                                        UniqueName="PurchaseOrderDetailBalance" DataFormatString="{0:N2}" DataType="System.Double">
                                    </telerik:GridNumericColumn>

                                    <telerik:GridCheckBoxColumn DataField="ReceivingProcessed" HeaderText="Receiving Processed" UniqueName="ReceivingProcessed" DataType="System.Boolean">
                                        <HeaderStyle Width="70px" />
                                        <ItemStyle Width="70px" />
                                    </telerik:GridCheckBoxColumn>
                                    <telerik:GridCheckBoxColumn DataField="InvoiceProcessed" HeaderText="Invoice Processed" UniqueName="InvoiceProcessed" DataType="System.Boolean">
                                        <HeaderStyle Width="70px" />
                                        <ItemStyle Width="70px" />
                                    </telerik:GridCheckBoxColumn>
                                    <telerik:GridNumericColumn DataField="PurchaseOrderDetailKey" HeaderText="PurchaseOrderDetailKey"
                                        UniqueName="PurchaseOrderDetailKey" DataType="System.Int32" Visible="False" ReadOnly="True">
                                    </telerik:GridNumericColumn>

                                </Columns>

                            </MasterTableView>
                        </telerik:RadGrid>






                        <asp:Panel ID="pnlChild" runat="server">

                            <telerik:RadGrid ID="grdReceiving" runat="server" AllowSorting="True" AutoGenerateColumns="False" GridLines="None">
                                <HeaderContextMenu EnableAutoScroll="True">
                                </HeaderContextMenu>

                                <ClientSettings>
                                    <Selecting />
                                    <ClientEvents OnRowDblClick="RowDblClick"
                                        OnPopUpShowing="centerFormPopUp" />
                                </ClientSettings>

                                <MasterTableView Caption="Receiving Information" CommandItemDisplay="Bottom" EditMode="PopUp"
                                        ClientDataKeyNames="ReceivingKey,ReceivedInFullStatusLkUpKey" DataKeyNames="ReceivingKey,ReceivedInFullStatusLkUpKey">
                                    <CommandItemSettings ShowRefreshButton="False" AddNewRecordText="Add New" AddNewRecordImageUrl="~/images/icons/addslim-16.png" />
                                    <NoRecordsTemplate>
                                        No detail lines to display.
                                    </NoRecordsTemplate>
                                    <Columns>
                                        <telerik:GridEditCommandColumn UniqueName="EditColumn">
                                        </telerik:GridEditCommandColumn>
                                        <telerik:GridBoundColumn HeaderText="Status" UniqueName="ReceivingStatus">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="ReceivedInFullStatusLkUpKey" Visible="false" HeaderText="ReceivedInFullStatusLkUpKey" UniqueName="ReceivedInFullStatusLkUpKey">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridNumericColumn DataField="ReceivedQuantity" HeaderText="Quantity"
                                            UniqueName="ReceivedQuantity" DataFormatString="{0:N4}" DataType="System.Double">
                                        </telerik:GridNumericColumn>
                                        <telerik:GridBoundColumn DataField="Comments" HeaderText="Comments" UniqueName="Comments">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridCheckBoxColumn DataField="Asset" HeaderText="Asset" UniqueName="Asset" DataType="System.Boolean" DefaultInsertValue="false">
                                            <HeaderStyle Width="70px" />
                                            <ItemStyle Width="70px" />
                                        </telerik:GridCheckBoxColumn>

                                        <telerik:GridDateTimeColumn DataField="ReceivedDate" HeaderText="Rec Date" UniqueName="ReceivedDate"
                                            DataFormatString="{0:MM/dd/yyyy}">
                                        </telerik:GridDateTimeColumn>

                                        <telerik:GridBoundColumn DataField="UserID" HeaderText="Rec By User" UniqueName="UserID">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="InvoiceNumber" HeaderText="Inv Num" UniqueName="InvoiceNumber">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridNumericColumn DataField="ReceivingKey" HeaderText="ReceivingKey"
                                            UniqueName="ReceivingKey" DataType="System.Int32" Visible="False" ReadOnly="True">
                                        </telerik:GridNumericColumn>

                                        <telerik:GridButtonColumn CommandName="Delete"
                                            ConfirmText="Are you sure you want to delete the selected item?" Text="Delete" 
                                            UniqueName="Delete">
                                        </telerik:GridButtonColumn>

                                    </Columns>

                                </MasterTableView>
                            </telerik:RadGrid>
                        
                        </asp:Panel>







    Protected Sub grdPODetails_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles grdPODetails.SelectedIndexChanged

        Dim iRow As Integer = grdPODetails.MasterTableView.GetSelectedItems(0).ItemIndex
        Dim item As GridDataItem = grdPODetails.MasterTableView.Items(iRow)
        Dim iPODetailKey As Integer = CType(item.GetDataKeyValue(FLDS.PurchaseOrderDetailKey.ToString).ToString, Integer)

        Dim dv As DataView = New DataView(Receivings)
        dv.RowFilter = "PurchaseOrderDetailKey=" & iPODetailKey
        grdReceiving.DataSource = dv.ToTable
        grdReceiving.Rebind()

    End Sub



Eyup
Telerik team
 answered on 25 Feb 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?