Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
187 views

Hi,

I have the following problem, in my RadGrid i have the operation update select and delete. Update and Select works fine. but the delete operation give me always the error that the parameter is null.

this is my grid

<telerik:RadGrid ID="radGrid1" AutoGenerateEditColumn="True" DataSourceID="objectDataSource1"
    runat="server" GridLines="None" Skin="Office2010Blue" AutoGenerateColumns="False">
    <MasterTableView AllowAutomaticUpdates="True" AllowAutomaticDeletes="True" CommandItemDisplay="Top" DataSourceID="ObjectDataSource1">
        <CommandItemSettings ShowAddNewRecordButton="false" />
        <Columns>
            <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
                <ItemStyle CssClass="MyImageButton" />
            </telerik:GridEditCommandColumn>
            <telerik:GridDropDownColumn DataField="AddressType" DataSourceID="objectDataSource1"
                HeaderText="Category" ListTextField="AddressType" ListValueField="AddressType"
                UniqueName="AddressType">
            </telerik:GridDropDownColumn>
            <telerik:GridDropDownColumn DataField="CategoryType" DataSourceID="objectDataSource1"
                HeaderText="CategoryType" ListTextField="CategoryType" ListValueField="CategoryType"
                UniqueName="CategoryType">
            </telerik:GridDropDownColumn>
            <telerik:GridDateTimeColumn DataField="NotificationDate" HeaderText="NotificationDate"
                UniqueName="NotificationDate" />
            <telerik:GridCheckBoxColumn DataField="NoticeOfReceipt" UniqueName="NoticeOfReceipt"
                HeaderText="NoticeOfReceipt" />
            <telerik:GridBoundColumn DataField="id" HeaderText="id" SortExpression="id" UniqueName="id" />
            <telerik:GridButtonColumn ConfirmText="Delete this product?" ConfirmDialogType="RadWindow"
                ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"
                UniqueName="DeleteColumn">
                <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
            </telerik:GridButtonColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

 

and this is my datasource

<asp:ObjectDataSource ID="objectDataSource1" TypeName="ESTV.A3.Logic.AddressCaseRelationBll" SelectMethod="Select" UpdateMethod="Update" DeleteMethod="Delete"
    runat="server">
    <SelectParameters>
        <asp:QueryStringParameter Name="addressId" Type="String" Direction="Input" QueryStringField="id">
        </asp:QueryStringParameter>
    </SelectParameters>
    <UpdateParameters>
        <asp:Parameter Name="id" Type="String" Direction="Input" />
        <asp:Parameter Name="NotificationDate" Type="DateTime" />
        <asp:Parameter Name="NoticeOfReceipt" Type="Boolean" />
        <asp:Parameter Name="AddressType" Type="String" />
        <asp:Parameter Name="CategoryType" Type="String" />
    </UpdateParameters>
    <DeleteParameters>
        <asp:Parameter Name="id" Type="String"/>
    </DeleteParameters>
</asp:ObjectDataSource>

in my DAO i have for the delete method the following code

public void Delete(string id)
{
    Guid guidId = new Guid(id);
    AddressCaseRelation addressCaseRelation = entityDao.GetById(guidId);
    entityDao.Delete(addressCaseRelation);
    entityDao.CommitChanges();
}

Regards

Pavlina
Telerik team
 answered on 16 Feb 2012
3 answers
151 views
I have a usercontrol with a public property that I'm trying to set using Eval with a databound Radgrid.

I'm trying to set the Acc Property to Eval("Acc").  It just won't stick.  By the time the usercontrol is loaded the property has been reset.

In the usercontrol, the property is just defined.  It's never set and has no default value.  I've tried to set it in the codebehind in the expand event of the nested view, and it still doesn't stick.

I've resorted to set it in the control itself with.

Acc = DirectCast(DirectCast(Me.Parent.Parent, Telerik.Web.UI.GridTableCell).Parent, Telerik.Web.UI.GridNestedViewItem).ParentItem.GetDataKeyValue("Acc")

Which I don't want to do because this control won't only be used in the gridview.  I'll handle those cases later, for now I just want to get this part working.  The markup is pasted below.  thanks.

<telerik:RadGrid ID="rgdQueue" runat="server" CellSpacing="0" DataSourceID="dsQueue"
    AllowFilteringByColumn="True" GridLines="None" AllowPaging="true" AllowSorting="true">
    <MasterTableView AutoGenerateColumns="False" DataSourceID="dsQueue" DataKeyNames="Acc">
        <NestedViewTemplate>
            <table style="width: 100%;">
                <tr>
                    <td>
                        <span style="font-size: 18pt; color: #010101; line-height: 30px;">Report</span>
                    </td>
                </tr>
                <tr>
                    <td style="width: 100%;">
                        <div style="border: 1px solid gray; padding-left: 25px; padding-right: 10px; padding-top: 10px;
                            padding-bottom: 10px;">
                            <%# Eval("OriginalReport") %>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <%# Eval("Acc") %>
                        <uc4:PeerReview Acc='<%# Eval("Acc") %>' ID="PRNested" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Button ID="btnSave" runat="server" Text="Save" CausesValidation="true" OnClick="btnSave_Click" ValidationGroup='<%# Eval("Acc") %>' />
                        <asp:Button ID="btnSign" runat="server" Text="Sign" CausesValidation="true" ValidationGroup='<%# Eval("Acc") %>' />
                        <asp:Button ID="btnNext" runat="server" Text="Next" OnClick="btnNext_Click" CausesValidation="false" />
                    </td>
                </tr>
            </table>
        </NestedViewTemplate>
        <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
        <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
            <HeaderStyle Width="20px"></HeaderStyle>
        </RowIndicatorColumn>
        <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
            <HeaderStyle Width="20px"></HeaderStyle>
        </ExpandCollapseColumn>
        <Columns>          
            <telerik:GridTemplateColumn DataField="QueueDate" FilterControlAltText="View Peer Review History"
                HeaderText="Date Added to Queue" SortExpression="QueueDate" UniqueName="QueueDate">
                <ItemTemplate>
                    <asp:Label ID="QueueDateLabel" runat="server" Text='<%# ConvertDateToInternational(Eval("QueueDate")) %>'></asp:Label>
                </ItemTemplate>
                <FilterTemplate>
                    <telerik:RadComboBox ID="rcbHistoryFilter" runat="server" OnSelectedIndexChanged="rcbHistoryFilterr_SelectedIndexChanged"
                        OnDataBound="rcbHistoryFilter_DataBound" Width="120" DataSourceID="dsQueueHistory"
                        DataTextField="Text" AutoPostBack="true" DataValueField="Months">
                    </telerik:RadComboBox>
                </FilterTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn HeaderText="Images" UniqueName="Images">
                <ItemTemplate>
                    <asp:Image Style="border-style: none;" ID="imgViewImages" Acc='<%# Eval("Acc") %>'
                        PatID='<%# Eval("PatientID") %>' SiteCode='<%# Eval("SiteCode") %>' Width="20"
                        Height="20" ImageUrl="../images/workstation.jpg" runat="server"></asp:Image>
                </ItemTemplate>
                <FilterTemplate>
                </FilterTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
        <EditFormSettings>
            <EditColumn FilterControlAltText="Filter EditCommandColumn column">
            </EditColumn>
        </EditFormSettings>
    </MasterTableView>
    <FilterMenu EnableImageSprites="False">
    </FilterMenu>
    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
    </HeaderContextMenu>
</telerik:RadGrid>

Veli
Telerik team
 answered on 16 Feb 2012
5 answers
177 views
Hello,

For client-side binding, it doesn't seem like it uses the <AppointmentTemplate>; is there a template it can use on client-side, or pretty much to display a custom template I need to create it programmatically through the AppointmentDataBound event?

Thanks.
Peter
Telerik team
 answered on 16 Feb 2012
1 answer
111 views
Hi Telerik,

To reproduce the scenario:

1. Create a .aspx page.
2. Add one script manager.
3. Add one update panel.
4. Add two buttons A and B (or whatever other controls to make postbacks) and one RadGrid inside the update panel.
5. Configure the grid to show some items in a column template. Configure the data binders.
6. Add a RadSocialShare control in the column template (to show for each item).
7. Configure the RadSocialShare control with some buttons (facebook, twitter, etc). Important: Do not add the SendEmail button yet!
8. Configure the two buttons A and B added in number 4. Do some kind of task to change the grid (sort, filter, ...). 
9. Run the page and you will see that everything is Ok. Buttons A and B, grid and social share buttons are working.
--> Now the BUG
10. Add the SendEmail button to the RadSocialShare control and run the page. The two buttons A and B don't work anymore. It seems that the autogenerated form for the SendEmail button generates some kind of js conflict. The error message follows.

(Error displayed in Chrome's dev tools):

Uncaught Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException: Impossible d'annuler l'inscription de UpdatePanel avec l'ID '', car il n'était pas inscrit auprès de ScriptManager. Cela peut se produire si UpdatePanel a été supprimé de l'arborescence du contrôle et rajouté ensuite, ce qui n'est pas pris en charge.
 
Nom du paramètre : updatePanel
Sys.WebForms.PageRequestManager._endPostBackTelerik.Web.UI.WebResource.axd:15
Sys.WebForms.PageRequestManager._parseDeltaTelerik.Web.UI.WebResource.axd:15
Sys.WebForms.PageRequestManager._onFormSubmitCompletedTelerik.Web.UI.WebResource.axd:15
(anonymous function)Telerik.Web.UI.WebResource.axd:6
(anonymous function)Telerik.Web.UI.WebResource.axd:6
Sys.Net.WebRequest.completedTelerik.Web.UI.WebResource.axd:6
_onReadyStateChange
 
Thanks,

John.
Marin Bratanov
Telerik team
 answered on 16 Feb 2012
5 answers
95 views
ChartSeries objSeriesActual = new ChartSeries("Actual", ChartSeriesType.Bar);
foreach (FinanceData objFinanceData in actualFinanceDataList)
{
    objSeriesActual.AddItem(objFinanceData.Revenue, objFinanceData.Revenue.ToString());
}
 
 
ChartSeries objSeriesBudget = new ChartSeries("Budget", ChartSeriesType.Bar);
foreach (FinanceData objFinanceData in budgetFinanceDataList)
{
    objSeriesBudget.AddItem(objFinanceData.Revenue, objFinanceData.Revenue.ToString());
}
 
 
revenueFinanceChart.Series.Add(objSeriesActual);
revenueFinanceChart.Series.Add(objSeriesBudget);
revenueFinanceChart.DataBind();

Dear Telerik,

I have made a chart that displays two series of actual and budget finance data for some companies. I would like to now replace the xaxis labels 1, 2, 3 etc underneath the bars with the name of the companies. I want this to be picked up from the financedata lists such as
using objSeriesActual.PlotArea.XAxis.AxisLabel.TextBlock.Text = objFinanceData.Name but this does not work; reference to object not found.
How can I accomplish this?
Evgenia
Telerik team
 answered on 16 Feb 2012
1 answer
82 views
Hi,

I see a few posts here on the slider.repaint(); and RadSlider1.ClientID as a possible fix.  We implemented this in order to allow a div/modal to appear without reloading the whole page.  No joy.

Here's the code:
function ShowDiv() {
                            var MainSearchDivID = '<%=MainSearchDiv.ClientID %>';
                            var MainD = document.getElementById(MainSearchDivID);
                            MainD.style.display = "block";

                            var btnShowDivID = '<%=btnShowDiv.ClientID %>';
                            var btnHideDivID = '<%=btnHideDiv.ClientID %>';

                            var btnShow = document.getElementById(btnShowDivID);
                            var btnHide = document.getElementById(btnHideDivID);

                            btnShow.style.display = "none";
                            btnHide.style.display = "block";
                            var slider = $find("<%= RadSlider1.ClientID %>");

                            slider.repaint();
                            return false;

                        }

We add the ShowDiv on the link which opens the div and yet the first panel shows nothing with the slider.  The slider uses letters a through z.  When you click 'b' you'll see the values associated with letter b and when you select a, you'll see the values associated with letter a.  It is as if the radslider1.clientid isn't recognized and that's why the results aren't populating.

Before my forehead finds the keyboard one more time...thoughts?   What are we missing.
Svetlina Anati
Telerik team
 answered on 16 Feb 2012
3 answers
192 views
I am creating a keyboard shortcuts for various actions on a page that uses the Telerik toolbar. In particular, I want Ctrl+S to save the inputted form info. There is already a Save button on our toolbar, so we want to just use a script to generate a click on that button rather than reconstruct the POST manually (which would be quite complicated). I am using John Resig's jQuery hotkey plugin, which is what is handling the bind statement. In all browsers, the selection of the Save button element or any of the related divs works.

The click registers perfectly in Firefox and IE9, but in Chrome the click does not work at all. Why might this be? The actual code is within a product that I can't really replicate here, but I've made a dummy page to the same effect. Here are the relevant snippets:

JS:
(function($) {
    $(document).ready(function() {
        $(document).bind('keydown', 'ctrl+s', function() {
        $("div#RadToolBar .rtbOut").click();
            return false;
        });
    });
})(jQuery);

ASPX:
<div class="save-button">
<telerik:radtoolbar id="radToolBar" runat="server" cssclass="toolbar">
  <items>
    <telerik:radtoolbarbutton navigateurl="~/default.aspx" postback="false" text="Goto Default Page" causesvalidation="false"/>
  </items>
</telerik:radtoolbar>
</
div>
Dimitar Terziev
Telerik team
 answered on 16 Feb 2012
3 answers
93 views

Why does my horizontal and vertical menus which use a background image and are totally controlled by the CSS settings work fine in IE 8, and Firefox and Safari

While in Chrome there is no images, no text formatting - just blue underlined links?  The sub menus do slide in and out but they are also just boring blue links?

Where do I hit Chrome to make it behave like the others?

Kate
Telerik team
 answered on 16 Feb 2012
1 answer
217 views
I am trying to access datakeyvalue in itemdatabound event of inner grid.This is code I am trying.
aspx;
<telerik:RadGrid runat="server" ID="RadGrid1" AutoGenerateColumns="true"
            DataSourceID="SqlDataSource1" AllowSorting="true" OnItemDataBound="RadGrid1_ItemDataBound"
            OnItemCreated="RadGrid1_ItemCreated">
<MasterTableView DataKeyNames="Storename" CommandItemDisplay="Top">
               
                <NestedViewSettings DataSourceID="SqlDataSource2">
                    <ParentTableRelation>
                        <telerik:GridRelationFields MasterKeyField="CustomerID" DetailKeyField="CustomerID" />
                    </ParentTableRelation>
                </NestedViewSettings>
                <NestedViewTemplate>
<telerik:RadGrid runat="server" ID="RadGrid2" DataSourceID="SqlDataSource2" OnItemDataBound="RadGrid2_ItemDataBound"
                            AllowSorting="true" AutoGenerateColumns="false">
                            <MasterTableView DataKeyNames="Orders" >
</MasterTableView>
                        </telerik:RadGrid>
                    
                </NestedViewTemplate>
 </telerik:RadGrid>
Shinu
Top achievements
Rank 2
 answered on 16 Feb 2012
2 answers
87 views

i have a slider without items. i want to create items manually and set selected style bold. 
is it possible?

regards

Ömer
Slav
Telerik team
 answered on 16 Feb 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
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
Bronze
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?