Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
813 views
hey everyone,

I have a radgrid,under whoch i've a textbox and 2 label.I want to show product of label1 and textbox on OnBlur property of text box into the second label.I am doing this--
<script type="text/javascript">         
            function FillAmount(sender, args) 
            {  
                var grid = $find("<%=RadGrid1.ClientID %>");
                var MasterTable = grid.get_MasterTableView();                  
                var txtQuantityE = $find('<%= txtQuantityE.ClientID %>')
                var lblRate = $find('<%= lblRate.ClientID %>'); 
                var lblAmount = $find('<%= lblAmount.ClientID %>');
                var Amount = $find(Number(txtQuantityE.value)*Number(lblRate.Text)).get_value(); 
                $find(lblAmount).set_value(Amount);  
            }        
            </script>
aspx has this under RadNumericTextBox <ClientEvents OnBlur="FillAmount" />
Can't find the controls its showing errors.Also is this proper way of finding product?....
plz help..

Thanks
Amit
Veli
Telerik team
 answered on 21 Oct 2010
2 answers
126 views
Hi,

I'm using the loop below to fill a GridDropDownColumn control with items from a customized LINQ query. That part works fine, so I did not include that code.

Private Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemDataBound
    If e.Item.IsInEditMode Then
        For Each Column As GridColumn In e.Item.OwnerTableView.Columns
            If Column.UniqueName = "ProductForReseller" Then
               ' Code goes here
            End If
        Next
    End If
End Sub

To finalize the query, I need to retrieve a value from one of the other cells (a GridDropDownColumn as well) in the same row. It's probably very simple, but I can't find how to get to that value. The HTML is listed below:

<telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="LinqDataSource1"
            AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" GridLines="None"
            Skin="Outlook" ShowGroupPanel="True" AllowAutomaticDeletes="True" AllowAutomaticInserts="True"
            AllowAutomaticUpdates="True" AutoGenerateColumns="False" Width="62em" Height="37em">
            <ClientSettings AllowDragToGroup="True">
                <Scrolling AllowScroll="True" />
            </ClientSettings>
            <MasterTableView DataKeyNames="reseller, product" EditMode="InPlace" CommandItemDisplay="Bottom"
                DataSourceID="LinqDataSource1">
                <SortExpressions>
                    <telerik:GridSortExpression FieldName="product" SortOrder="Ascending" />
                </SortExpressions>
                <GroupByExpressions>
                    <telerik:GridGroupByExpression>
                        <SelectFields>
                            <telerik:GridGroupByField FieldName="reseller" HeaderText="Reseller" />
                        </SelectFields>
                        <GroupByFields>
                            <telerik:GridGroupByField FieldName="reseller" HeaderText="Reseller" />
                        </GroupByFields>
                    </telerik:GridGroupByExpression>
                </GroupByExpressions>
                <Columns>
                    <telerik:GridEditCommandColumn EditText="edit" HeaderStyle-Width="7em">
                    </telerik:GridEditCommandColumn>
                    <telerik:GridDropDownColumn UniqueName="Reseller" ListTextField="name" ListValueField="id"
                        DataSourceID="LinqDataSourceReseller" HeaderText="Reseller" DataField="reseller"
                        DropDownControlType="RadComboBox" AllowSorting="true" HeaderStyle-Width="7em"
                        AllowFiltering="false">
                    </telerik:GridDropDownColumn>
                    <telerik:GridDropDownColumn UniqueName="ProductForReseller" ListTextField="name" ListValueField="id"
                        DataSourceID="LinqDataSourceProduct" HeaderText="Product" DataField="product"
                        DropDownControlType="RadComboBox" AllowSorting="true" HeaderStyle-Width="7em"
                        AllowFiltering="false">
                    </telerik:GridDropDownColumn>
                    <telerik:GridDropDownColumn UniqueName="ProductActivationType" ListTextField="name"
                        ListValueField="id" DataSourceID="LinqDataSource2" HeaderText="Activation type"
                        DataField="product_activation_type" DropDownControlType="RadComboBox" AllowSorting="true"
                        HeaderStyle-Width="7em" AllowFiltering="false">
                    </telerik:GridDropDownColumn>
                    <telerik:GridButtonColumn CommandName="Delete" Text="Delete" UniqueName="Delete"
                        HeaderStyle-Width="7em">
                    </telerik:GridButtonColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>

I want to retrieve the value of the column "Reseller". How can I do it?
Arno
Top achievements
Rank 2
 answered on 21 Oct 2010
1 answer
116 views
Hi,
    Is there anyway that i can make my combobox is always in expanded state.....



Shinu
Top achievements
Rank 2
 answered on 21 Oct 2010
1 answer
92 views

I'm displaying a context menu when right-clicking a radgrid. How do I access radgrids columns?

Thanks for the help!

  Protected Sub RadContextMenu1_ItemClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadMenuEventArgs) Handles RadContextMenu1.ItemClick
  
        Dim radGridClickedRowIndex As Integer = Convert.ToInt32(Request.Form("radGridClickedRowIndex"))
        Dim radGridClickedRow As GridDataItem = CType(RadGrid1.Items(radGridClickedRowIndex), GridDataItem)
'How do I access radGridClickedRow column here? 
        mpuDuplicateTrip.Show() ' show ModalPopup
  
    End Sub
Pavlina
Telerik team
 answered on 21 Oct 2010
9 answers
162 views
Hi,

We are facing some issue while creating the page with telerik editor. Screen shot also attached for the same error below mentioned.
I am getting "Click Auto Correct on the toolbar to remove invalid content or formatting". I am not able to figure out where auto correct icon is in toolbar. Will apreciate if someone can help me on that.



Stanimir
Telerik team
 answered on 21 Oct 2010
8 answers
565 views
Hi,

In my current project I have a RadGrid with multilevel grouping of items.

The items displayed on the RadGrid are stored in a DataSet.

When any of items in the DataSet changes (because of some operations on the web page), I redisplay the RadGrid as follows:

this.RadGrid.DataSource = DataSet;
this.RadGrid.DataBind();

However, this causes all the RadGrid items to be collapsed (if any of them has been expanded).

Can you please show me how to redisplay the updated DataSet on the RadGrid and at the same time preserving the expanded items?

Please note that all operations need to be done on the server (instead of client)?

Regards,
Herman
Herman Gouw
Top achievements
Rank 2
 answered on 21 Oct 2010
2 answers
74 views
Hi there,

I really like the telerik ajax tools, but I have a slight problem now: the property value of a subobject is not displayed in the grid: Status.Shortcut. Pasting the json code (extracted by fiddler2) into a json viewser, looks ok.

Telerik-Version: v.2010.2.929.35

Even when creating a client side array, it doesn't display subobject's values.

Alerting the field says: ok - is there.


WHAT CAN I DO? Please help.

Thank you very much.

Client-Side DataBinding:
function UpdateGrid(rows) {
            clearError();
            var grid = $find("<%=gridTickets.ClientID %>");
            var mtv = grid.get_masterTableView();
  
            alert(rows[0].Status.Shortcut); //  <--WORKS GREAT!!!!
  
            mtv.set_dataSource(rows);
            mtv.dataBind();
            return;
        }


Page.aspx:
<telerik:RadGrid ID="gridTickets" runat="server" >
    <MasterTableView DataKeyNames="Id">
        <Columns>
            <telerik:GridBoundColumn DataField="Id" HeaderText="Id" Display="false" />
            <telerik:GridBoundColumn DataField="Status.Shortcut" HeaderText="Status" />
            <telerik:GridBoundColumn DataField="Subject" HeaderText="Betreff" />
        </Columns>
    </MasterTableView>
</telerik:RadGrid>


The JSONed Data

{
  "d": [
    {
      "__type": "Ticket:#TicketWeb.Entities",
      "Area": {
        "__type": "TicketArea:#TicketWeb.Entities",
        "Id": 0,
        "Name": "test",
        "Shortcut": "test"
      },
      "AreaId": 0,
      "Comments": null,
      "CostCenter": null,
      "CostCenterId": 0,
      "Created": "\/Date(1287085525987+0200)\/",
      "DontSendMailsAtInsert": false,
      "DueDate": null,
      "Duration": 0,
      "FinishDate": null,
      "From": null,
      "FromId": 0,
      "Guid": "6d9ac3f8-2bd4-4338-83cc-e85375e90039",
      "Id": 0,
      "InCharge": null,
      "InChargeId": 0,
      "LegacyId": null,
      "LegacyUid": null,
      "Logs": null,
      "ParentTicket": null,
      "ParentTicketId": 0,
      "PercentFinished": 0,
      "PhoneNumber": null,
      "Priorities": [
        {
          "__type": "Priority:#TicketWeb.Entities",
          "Value": 0
        },
        {
          "__type": "Priority:#TicketWeb.Entities",
          "Value": 1
        },
        {
          "__type": "Priority:#TicketWeb.Entities",
          "Value": 2
        },
        {
          "__type": "Priority:#TicketWeb.Entities",
          "Value": 3
        }
      ],
      "Priority": 0,
      "Reason": null,
      "ReceivedDate": null,
      "Responsible": null,
      "ResponsibleId": 0,
      "Revision": 0,
      "SortIndex": 0,
      "Specification": null,
      "StartDate": null,
      "Status": {
        "__type": "Status:#TicketWeb.Entities",
        "Id": 0,
        "MarksFinish": false,
        "MarksStart": false,
        "MarksStatusForNewSubProjects": false,
        "Name": "testkaka",
        "SetForNewTickets": false,
        "Shortcut": "kakakka",
        "SortIndex": 0
      },
      "StatusId": 0,
      "SubProjects": null,
      "Subject": "HI",
      "TicketReasonId": 0,
      "TicketType": null,
      "TicketTypeId": null,
      "TypeOfCosts": null,
      "TypeOfCostsId": 0
    }
  ]
}
Nikolay Rusev
Telerik team
 answered on 21 Oct 2010
1 answer
301 views
I have a very simple Grid that includes a hyperlink column using an image as the link:

<telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="sds_Credentials" GridLines="None" Skin="WebBlue" AllowSorting="True" Width="800px">
<MasterTableView AutoGenerateColumns="False" DataKeyNames="IDCredentials" DataSourceID="sds_Credentials">
<CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
    <Columns>
        <telerik:GridBoundColumn DataField="CredentialName" HeaderText="Credential" 
            SortExpression="CredentialName" UniqueName="CredentialName">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="UserLogin" HeaderText="Login" 
            SortExpression="UserLogin" UniqueName="UserLogin">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="UserPassword" HeaderText="Password" 
            SortExpression="UserPassword" UniqueName="UserPassword">
        </telerik:GridBoundColumn>
        <telerik:GridHyperLinkColumn DataNavigateUrlFields="Website" HeaderText=" "
            DataNavigateUrlFormatString="{0}"
            UniqueName="Website" AllowFiltering="False" ItemStyle-HorizontalAlign="Center">
        <ItemStyle Width="50px" CssClass="radgrid" />
        </telerik:GridHyperLinkColumn>
        <telerik:GridHyperLinkColumn DataNavigateUrlFields="IDCredentials" HeaderText=" "
            DataNavigateUrlFormatString="credentials_details.aspx?IDCredentials={0}" 
            Text="Details" UniqueName="IDRolodex" AllowFiltering="False" ItemStyle-HorizontalAlign="Center">
        <ItemStyle Width="75px" CssClass="tbltdbutton" />
        </telerik:GridHyperLinkColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

Code behind:

Protected Sub RadGrid1_ItemDataBound1(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemDataBound
    If TypeOf e.Item Is GridDataItem Then
        Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)
        Dim hyplnk As HyperLink = DirectCast(item("Website").Controls(0), HyperLink)
        hyplnk.ImageUrl = "../../../images/iconIE.gif"
        hyplnk.Target = "_blank"
    End If
End Sub

This works great.

However, I would like to hide the image if there is no hyperlink in the data field. Something like:


Protected Sub RadGrid1_ItemDataBound1(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemDataBound
    If TypeOf e.Item Is GridDataItem Then
        Dim item As GridDataItem = TryCast(e.Item, GridDataItem)
        Dim value As String = item("Website").Text
        If value < "1" Then
            Dim hLink As HyperLink = DirectCast(item("Website").Controls(0), HyperLink)
            hLink.ImageUrl = "../../../images/iconIE.gif"
            hLink.Target = "_blank"
            hLink.Visible = False
        End If
    End If
  
End Sub

This does not work. Any help would be much appreciated.

Princy
Top achievements
Rank 2
 answered on 21 Oct 2010
1 answer
53 views
hi,
im not sure this is the right place..
anyway, i'm having some problems with callback function of a webservice..

i'm calling the next webservice for example..
Services.Action(param, onComplete)...

function onComplete(res)
{
alert('success');
}
and for some reason the callback function doesnt always called...

i try to change the web service so it wont accept a parameter...
and called it like this: Services.Action(onComplete)...
and this time the callback function was called..

anyone got an idea, what the problem could be?
Fiko
Telerik team
 answered on 21 Oct 2010
2 answers
138 views
Hi,

Here I am facing problem related to RadWindow in RadTabStrip with Contaxt Menu. As I have managed RadWindow Open functionality through code behind on Itemclick of Contaxt menu. On each click of contaxt menu in RadGrid I need to open RadWindow. But here once I open the RadWindow in one Grid through contaxt menu and after closing it when I go for next Tab then last radwindow load automatically.

This my code how I am managing radwindow thru code behind onItemclick of contaxt menu:

protected

 

 

void rcmFormContextMenu_ItemClick(object sender, RadMenuEventArgs e)

 

{

 

 

if (rtsEditEntity.SelectedTab.Value == "6")

 

{

 

 

int _formId = Convert.ToInt32(hiddenFormId.Value);

 

 

 

RadWindow rwForm = new RadWindow();

 

rwForm.ID =

 

"RadWindow1";

 

 

 

rwForm.NavigateUrl = "~/FormsViews/EditForm.aspx";

 

rwForm.VisibleOnPageLoad =

 

true;

 

rwForm.Modal =

 

true;

 

rwForm.Overlay =

 

true;

 

rwForm.Behaviors =

 

WindowBehaviors.Close;

 

rwForm.Width = 1000;

rwForm.Height = 650;

 

 

if (rwmForm.Windows.Count > 0)

 

{

rwmForm.Windows.RemoveAt(0);

}

rwmForm.Windows.Add(rwForm);

}

}

 

 

protected void rcmViewContextMenu_ItemClick(object sender, RadMenuEventArgs e)

 

{

 

 

if (rtsEditEntity.SelectedTab.Value == "5")

 

{

 

 

int _ViewId = Convert.ToInt32(hiddenViewId.Value);

 

 

 

RadWindow rwView = new RadWindow();

 

rwView.ID =

 

"RadWindow2";

 

 

 

rwView.NavigateUrl = "~/FormsViews/EditView.aspx";

 

rwView.VisibleOnPageLoad =

 

true;

 

rwView.Modal =

 

true;

 

rwView.Overlay =

 

true;

 

rwView.Behaviors =

 

WindowBehaviors.Close;

 

rwView.Width = 1000;

rwView.Height = 650;

 

 

if (rwmView.Windows.Count > 0)

 

{

rwmView.Windows.RemoveAt(0);

}

rwmView.Windows.Add(rwView);

}

}



I don't understand how it will happend?
Please assist me.

Thanks & Regards,

Kaushal Jani
Kaushal
Top achievements
Rank 1
 answered on 21 Oct 2010
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
Andrey
Top achievements
Rank 1
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
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?