+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Problem in RadGrid edit/insert mode

Problem in RadGrid edit/insert mode

6 posts, 0 answered
  1. Pawel
    Pawel avatar
    12 posts
    Registered:
    02 Jan 2008
    04 Mar 2010
    Link to this post
    Hi.
    I have a problem with insert/edit mode of the Telerik RadGrid in Sitefinity.
    I had a page that I converted into a ascx control. This control contains two grids and some buttons. If a control is added to normal page in project in visual studio, edit/insert mode (available in one of grids) works fine. When I add this control to a page in sitefinity there is a real set of problems:
    1. RadEditor and RadComboBox-es that are in insert/edit are not available (they look like enabled, but I can't edit values)
    2. RadDatePicker does not allow to open date popup, but I can put value in its textbox
    3. In insert mode a scrolling does not work, so insertion area is very big, and does not interacts with other controls on page, so is hidden or overlapped with them.
    What can cause such problem? How can I manage with it?
    Greetings:
    Pawel  
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    19 Sep 2016
    04 Mar 2010
    Link to this post
    Hello Pawel,

    Can you send a sample runnable control, so we could see the problems you described? Most of the backend views are based on RadGrid, also I have created lots of RadGrid controls in a various custom implementations for the front end and there ware not any problems. Sample working code can be found in this blog post - Insert/Update/Delete content items with RadGrid for ASP.NET AJAX . Another sample - Implementing client-side data binding for RadGrid

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. Pawel
    Pawel avatar
    12 posts
    Registered:
    02 Jan 2008
    04 Mar 2010
    Link to this post
    Hi.
    Thanks for your answer.
    I am not sure what do you mean by runnable.
    This is strictly dedicated control, that uses particular data, so I don't know how to change it, to allow it to be used without additional context.
    I use it in content area in a Sitefinity page with ModernLight theme.
    I hope this will help to identify a problem.
    Greetings:
    Pawel

    code:

    ascx:

    <%

    @ Control Language="C#" AutoEventWireup="true" CodeFile="ClientsFundsAndProjects.ascx.cs" Inherits="ClientsFundsAndProjects" %>

     

    <%

    @ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

     

     

    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server">

     

     

    </telerik:RadStyleSheetManager>

     

     

    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

     

     

    <AjaxSettings>

     

     

    <telerik:AjaxSetting AjaxControlID="RadGrid1">

     

     

    <UpdatedControls>

     

     

    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />

     

     

    </UpdatedControls>

     

     

    </telerik:AjaxSetting>

     

     

    <telerik:AjaxSetting AjaxControlID="RadGrid2">

     

     

    <UpdatedControls>

     

     

    <telerik:AjaxUpdatedControl ControlID="RadGrid2" />

     

     

    </UpdatedControls>

     

     

    </telerik:AjaxSetting>

     

     

    </AjaxSettings>

     

     

    </telerik:RadAjaxManager>

     

     

    <div>

     

     

    <telerik:RadGrid ID="RadGrid2" runat="server" AllowAutomaticDeletes="True" AllowAutomaticInserts="True"

     

     

    AllowAutomaticUpdates="True" AllowPaging="True" AllowMultiRowSelection="True"

     

     

    AllowSorting="True" DataSourceID="USPCon" GridLines="None" OnItemDeleted="RadGrid2_ItemDeleted"

     

     

    OnItemInserted="RadGrid2_ItemInserted" OnItemUpdated="RadGrid2_ItemUpdated" Style="z-index: 5000;

     

    left: 4px; top: 515px"

     

    Width="950px" OnItemCreated="RadGrid2_ItemCreated" Height="397px" ShowStatusBar="True" showfooter="True" >

     

    <

     

    PagerStyle Mode="NextPrevNumericAndAdvanced"></PagerStyle>

     

    <

     

    MasterTableView HorizontalAlign="NotSet" DataKeyNames="ID" DataSourceID="USPCon" AutoGenerateColumns="False" Name="Projects" CommandItemDisplay="Top"><DetailTables>

     

    <

     

    telerik:GridTableView runat="server" DataKeyNames="ID,FK_PROJEKTU" ClientDataKeyNames="ID,FK_PROJEKTU" DataSourceID="SqlDataSource4" AutoGenerateColumns="False" Name="FundsForProjects"><ParentTableRelation>

     

    <

     

    telerik:GridRelationFields MasterKeyField="ID" DetailKeyField="FK_PROJEKTU"></telerik:GridRelationFields>

     

    </

     

    ParentTableRelation>

     

    <

     

    Columns>

     

    <

     

    telerik:GridBoundColumn DataField="ID" HeaderText="Id" SortExpression="ID" Visible="False" UniqueName="ID"></telerik:GridBoundColumn>

     

    <

     

    telerik:GridBoundColumn DataField="FUNDUSZ" HeaderText="Fundusz" SortExpression="FUNDUSZ" UniqueName="FUNDUSZ"></telerik:GridBoundColumn>

     

    <

     

    telerik:GridBoundColumn DataField="KRAJ" HeaderText="Kraj" SortExpression="KRAJ" UniqueName="KRAJ"></telerik:GridBoundColumn>

     

    <

     

    telerik:GridBoundColumn DataField="MIASTO" HeaderText="Miasto" SortExpression="MIASTO" UniqueName="MIASTO"></telerik:GridBoundColumn>

     

    <

     

    telerik:GridBoundColumn DataField="FK_PROJEKTU" HeaderText="FK_PROJEKTU" SortExpression="FK_PROJEKTU" Visible="False" UniqueName="FK_PROJEKTU"></telerik:GridBoundColumn>

     

    <

     

    telerik:GridButtonColumn ConfirmTitle="Delete" ButtonType="ImageButton" ConfirmDialogType="RadWindow" CommandName="Delete" Text="Delete" ConfirmText="Czy usunąć zgłoszenie do tego funduszu?" UniqueName="DeleteColumn">

     

    <

     

    ItemStyle HorizontalAlign="Center" CssClass="MyImageButton"></ItemStyle>

     

    </

     

    telerik:GridButtonColumn>

     

    </

     

    Columns>

     

    </

     

    telerik:GridTableView>

     

    </

     

    DetailTables>

     

    <

     

    CommandItemSettings AddNewRecordText="Dodaj Projekt" RefreshText="Odświerz"></CommandItemSettings>

     

    <

     

    ExpandCollapseColumn Visible="True"></ExpandCollapseColumn>

     

    <

     

    Columns>

     

    <

     

    telerik:GridEditCommandColumn ButtonType="ImageButton">

     

    <

     

    ItemStyle CssClass="MyImageButton"></ItemStyle>

     

    </

     

    telerik:GridEditCommandColumn>

     

    <

     

    telerik:GridBoundColumn DataField="ID" ReadOnly="True" HeaderText="Id" SortExpression="ID" UniqueName="ID" DataType="System.Decimal"></telerik:GridBoundColumn>

     

    <

     

    telerik:GridBoundColumn DataField="NAZWA_PROJEKTU" HeaderText="Nazwa Projektu" SortExpression="NAZWA_PROJEKTU" UniqueName="NAZWA_PROJEKTU"></telerik:GridBoundColumn>

     

    <

     

    telerik:GridHTMLEditorColumn DataField="OPIS_PROJEKTU" ColumnEditorID="GridHTMLEditorColumnEditor1" HeaderText="Opis" SortExpression="OPIS_PROJEKTU" UniqueName="OPIS_PROJEKTU"></telerik:GridHTMLEditorColumn>

     

    <

     

    telerik:GridDateTimeColumn DataField="PREFEROWANA_DATA_STARTU" HeaderText="Prefer. Data Startu" SortExpression="PREFEROWANA_DATA_STARTU" UniqueName="PREFEROWANA_DATA_STARTU"></telerik:GridDateTimeColumn>

     

    <

     

    telerik:GridDropDownColumn DataSourceID="SqlDataSource1" ListTextField="NAZWA_FAZY" ListValueField="ID" DataField="FAZA_USLUGA" HeaderText="Faza/Usługa" UniqueName="FAZA_USLUGA" DataType="System.Decimal"></telerik:GridDropDownColumn>

     

    <

     

    telerik:GridNumericColumn DataField="WYMAGANA_KWOTA_INWESTYCJI" HeaderText="Inwestycja" SortExpression="WYMAGANA_KWOTA_INWESTYCJI" UniqueName="WYMAGANA_KWOTA_INWESTYCJI" DataType="System.Decimal"></telerik:GridNumericColumn>

     

    <

     

    telerik:GridDropDownColumn DataSourceID="SqlDataSource2" ListTextField="NAZWA_BRANZY" ListValueField="ID" DataField="SEKTOR" HeaderText="Branża/Sektor" UniqueName="NAZWA_BRANZY" DataType="System.Decimal"></telerik:GridDropDownColumn>

     

    <

     

    telerik:GridNumericColumn DataField="OCZEKIWANY_ZYSK_CALKOWITY" HeaderText="Zysk Całkowity" SortExpression="OCZEKIWANY_ZYSK_CALKOWITY" UniqueName="OCZEKIWANY_ZYSK_CALKOWITY" DataType="System.Decimal"></telerik:GridNumericColumn>

     

    <

     

    telerik:GridBoundColumn DataField="WIDOCZNY_DLA_SUBSKRYBUJACYCH" HeaderText="Widoczny dla Innych Funduszy" SortExpression="WIDOCZNY_DLA_SUBSKRYBUJACYCH" UniqueName="WIDOCZNY_DLA_SUBSKRYBUJACYCH" DataType="System.Decimal"></telerik:GridBoundColumn>

     

    <

     

    telerik:GridDropDownColumn DataSourceID="SqlDataSource3" ListTextField="WALUTA" ListValueField="WALUTA" DataField="WALUTA" HeaderText="Waluta" UniqueName="WALUTA"></telerik:GridDropDownColumn>

     

    <

     

    telerik:GridButtonColumn ConfirmTitle="Delete" ButtonType="ImageButton" ConfirmDialogType="RadWindow" CommandName="Delete" Text="Delete" ConfirmText="Czy usunąć ten projekt i wszystkie jego zgłoszenia do funduszy?" UniqueName="DeleteColumn">

     

    <

     

    ItemStyle HorizontalAlign="Center" CssClass="MyImageButton"></ItemStyle>

     

    </

     

    telerik:GridButtonColumn>

     

    </

     

    Columns>

     

    <

     

    EditFormSettings ColumnNumber="2" CaptionDataField="ID" CaptionFormatString="Edit properties of Product {0}">

     

    <

     

    EditColumn ButtonType="ImageButton" CancelText="Cancel edit" UpdateText="Update record" InsertText="Insert Order" UniqueName="EditCommandColumn1"></EditColumn>

     

    <

     

    FormTableStyle CellPadding="2" CellSpacing="0" BackColor="White" Height="110px"></FormTableStyle>

     

    <

     

    FormMainTableStyle CellPadding="3" CellSpacing="0" BackColor="White" Width="100%"></FormMainTableStyle>

     

    <

     

    FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle>

     

    <

     

    FormTableItemStyle Wrap="False"></FormTableItemStyle>

     

    <

     

    FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>

     

    <

     

    FormTableButtonRowStyle HorizontalAlign="Right" CssClass="EditFormButtonRow"></FormTableButtonRowStyle>

     

    </

     

    EditFormSettings>

     

    <

     

    EditItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Wrap="True" Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" Font-Underline="False"></EditItemStyle>

     

    <

     

    FilterItemStyle Wrap="False"></FilterItemStyle>

     

    </

     

    MasterTableView>

     

    <

     

    ClientSettings>

     

    <

     

    Selecting AllowRowSelect="True"></Selecting>

     

    <

     

    Scrolling AllowScroll="True" UseStaticHeaders="True"></Scrolling>

     

    </

     

    ClientSettings>

     

    <

     

    EditItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="True" Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" Font-Underline="False"></EditItemStyle>

     

    </

     

    telerik:RadGrid>

     

     

    </div>

     

     

    <div>

     

     

    <telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" AllowPaging="True"

     

     

    AllowSorting="True" GridLines="None" Style="z-index: 100;

     

    left: 0px; top: 0px"

     

    OnItemCreated="RadGrid1_ItemCreated" OnNeedDataSource="RadGrid1_NeedDataSource" Width="950px" AllowMultiRowSelection="True" Height="350px" ShowStatusBar="True">

     

     

    <MasterTableView ClientDataKeyNames="ID">

     

     

    <Columns>

     

     

    <telerik:GridClientSelectColumn UniqueName="column" />

     

     

    <telerik:GridTemplateColumn HeaderText="Lokalizacja funduszu" UniqueName="TemplateColumn1">

     

     

    <ItemTemplate>

     

     

    <asp:HyperLink ID="FundLocationMap" runat="server" Text="Mapa"></asp:HyperLink>

     

     

    </ItemTemplate>

     

     

    </telerik:GridTemplateColumn>

     

     

    <telerik:GridTemplateColumn HeaderText="Dane szczeg&#243;łowe" UniqueName="TemplateColumn2">

     

     

    <ItemTemplate>

     

     

    <asp:HyperLink ID="FundDetailsLink" runat="server" Text="Informacje"></asp:HyperLink>

     

     

    </ItemTemplate>

     

     

    </telerik:GridTemplateColumn>

     

     

     

    </Columns>

     

     

    </MasterTableView>

     

     

    <ClientSettings>

     

     

    <Selecting AllowRowSelect="True" />

     

     

    <Scrolling AllowScroll="True" UseStaticHeaders="True" />

     

     

    <ClientEvents OnRowCreated="RadGrid1_RowCreated" OnRowSelected="RadGrid1_RowSelected"

     

     

    OnRowDeselected="RadGrid1_RowDeselected" />

     

     

    </ClientSettings>

     

     

    </telerik:RadGrid>

     

     

    </div>

     

     

    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Behavior="Default"

     

     

    InitialBehavior="None" Left="" Style="z-index: 101; left: 0px; position: absolute;

     

    top: 0px"

     

    Top="">

     

     

    </telerik:RadWindowManager>

     

     

    <telerik:RadWindow ID="RadWindow1" runat="server" Style="z-index: 999; left: 0px;

     

    position: absolute; top: 0px">

     

    </telerik:RadWindow>

     

     

     

    <telerik:RadWindow ID="rwDialog" runat="server" Modal="True" NavigateUrl="selectProcessesToStart.aspx"

     

     

    OpenerElementID="Button1" ReloadOnShow="true" OnClientClose="clientClose" OnClientShow="clientShow" Style="z-index: 999; position: absolute">

     

     

    </telerik:RadWindow>

     

     

     

    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

     

     

    <script type="text/javascript">

     

     

    var grid = null;

     

     

     

    function ShowMap(id, rowIndex)

     

    {

     

    //var grid = $find("<%= RadGrid1.ID %>");

     

     

     

    var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();

     

    grid.get_masterTableView().selectItem(rowControl,

    true);

     

     

     

    var oWnd = window.radopen("ShowFundLocation.aspx?id=" + id, "RadWindow1");

     

    oWnd.setSize(540,440);

    oWnd.moveTo(5,5);

     

    return false;

     

    }

     

     

    function ShowDetails(id, rowIndex)

     

    {

     

    //var grid = $find("<%= RadGrid1.ID %>");

     

     

     

    var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();

     

    grid.get_masterTableView().selectItem(rowControl,

    true);

     

     

     

    var oWnd = window.radopen("FundDetailedData.aspx?fundId=" + id, "RadWindow1");

     

    oWnd.setSize(985,850);

    oWnd.moveTo(5,5);

     

    return false;

     

    }

     

     

    var selected = {};

     

     

    function RadGrid1_RowSelected(sender, args) {

     

     

    var fundID = args.getDataKeyValue("ID");

     

     

    if (!selected[fundID]) {

     

    selected[fundID] =

    true;

     

    }

    }

     

     

    function RadGrid1_RowDeselected(sender, args) {

     

     

    var fundID = args.getDataKeyValue("ID");

     

     

    if (selected[fundID]) {

     

    selected[fundID] =

    null;

     

    }

    }

     

     

    function RadGrid1_RowCreated(sender, args) {

     

    grid = sender;

     

    var fundID = args.getDataKeyValue("ID");

     

     

    if (selected[fundID]) {

     

    args.get_gridDataItem().set_selected(

    true);

     

    }

    }

     

     

    function AjaxRequest()

     

    {

     

    var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");

     

     

    var selectedIdentifiers = new String();

     

     

    for (var current in selected)

     

    {

    selectedIdentifiers = selectedIdentifiers +current +

    ",";

     

    }

    ajaxManager.ajaxRequest(selectedIdentifiers);

    }

     

     

    function AjaxRequestButton()

     

    {

     

    var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");

     

     

    var selectedIdentifiers = new String();

     

     

    for (var current in selected)

     

    {

    selectedIdentifiers = selectedIdentifiers +current +

    ",";

     

    }

    ajaxManager.ajaxRequestWithTarget(

    '<%= RadGrid2.UniqueID %>', selectedIdentifiers);

     

    }

     

     

    function AjaxRequestButtonDeleteUserFunds()

     

    {

     

    var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");

     

     

    var selectedIdentifiers = new String();

     

     

    for (var current in selected)

     

    {

    selectedIdentifiers = selectedIdentifiers +current +

    ",";

     

    }

    ajaxManager.ajaxRequestWithTarget(

    '<%= RadGrid1.UniqueID %>', 'RadGrid1_' + selectedIdentifiers);

     

    }

     

     

    var txtInput = null;

     

     

    function clientShow(sender, eventArgs)

     

    {

     

    var selectedIdentifiers = new String();

     

     

    for (var current in selected)

     

    {

     

    if(selected[current])

     

    {

    selectedIdentifiers = selectedIdentifiers + current +

    ",";

     

    }

    }

     

    //var txtInput = selectedIdentifiers;

     

     

    //sender.argument = txtInput;

     

    txtInput = selectedIdentifiers;

    sender.argument = txtInput;

    }

     

    function clientClose(sender,args)

     

    {

     

    if (args.get_argument()!= null)

     

    {

     

    var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");

     

     

    var selectedIdentifiers = args.get_argument();

     

    ajaxManager.ajaxRequestWithTarget(

    '<%= RadGrid2.UniqueID %>', 'RadGrid2_' + txtInput + "***" + selectedIdentifiers);

     

    }

    }

     

    </script>

     

     

    </telerik:RadCodeBlock>

     

     

     

     

    <input id="Button1" style=" left: 3px; width: 297px;

     

    top: 427px"

     

    type="button" value="Zgłoś wybrane projekty do wskazanych funduszy"/>

     

     

    <input id="Button2" style=" left: 308px; top: 427px; width: 345px;"

     

     

    type="button" value="Usuń wybrane fundusze z podręcznej listy użytkownika" onclick="return AjaxRequestButtonDeleteUserFunds()" />

     

     

    <asp:Button ID="Button3" runat="server" OnClick="Button3_Click" Style="

     

    left: 660px; top: 427px; width: 220px"

     

    Text="Powrót do wyszukiwania funduszy" />

     

     

    <asp:Button ID="Button4" runat="server" OnClick="Button4_Click" Style="

     

    left: 3px; top: 452px"

     

    Text="Wejdź do obsługi procesów i dokumentów"

     

     

    Width="946px" />

     

     

    <br />

     

     

     

    <asp:SqlDataSource ID="USPCon" runat="server" ConflictDetection="CompareAllValues"

     

     

    ConnectionString="<%$ ConnectionStrings:UserProjectsConnectionString %>" DeleteCommand='DELETE FROM "WEB_F_PROJEKTY" WHERE "ID" = :oID OR (("NAZWA_PROJEKTU" = :oNAZWA_PROJEKTU) OR ("NAZWA_PROJEKTU" IS NULL AND :oNAZWA_PROJEKTU IS NULL)) AND (("OPIS_PROJEKTU" = :oOPIS_PROJEKTU) OR ("OPIS_PROJEKTU" IS NULL AND :oOPIS_PROJEKTU IS NULL)) AND (("PREFEROWANA_DATA_STARTU" = :oPREFEROWANA_DATA_STARTU) OR ("PREFEROWANA_DATA_STARTU" IS NULL AND :oPREFEROWANA_DATA_STARTU IS NULL)) AND (("FAZA_USLUGA" = :oFAZA_USLUGA) OR ("FAZA_USLUGA" IS NULL AND :oFAZA_USLUGA IS NULL)) AND (("WYMAGANA_KWOTA_INWESTYCJI" = :oWYMAGANA_KWOTA_INWESTYCJI) OR ("WYMAGANA_KWOTA_INWESTYCJI" IS NULL AND :oWYMAGANA_KWOTA_INWESTYCJI IS NULL)) AND (("SEKTOR" = :oSEKTOR) OR ("SEKTOR" IS NULL AND :oSEKTOR IS NULL)) AND (("OCZEKIWANY_ZYSK_CALKOWITY" = :oOCZEKIWANY_ZYSK_CALKOWITY) OR ("OCZEKIWANY_ZYSK_CALKOWITY" IS NULL AND :oOCZEKIWANY_ZYSK_CALKOWITY IS NULL)) AND (("WIDOCZNY_DLA_SUBSKRYBUJACYCH" = :oWIDOCZNY_DLA_SUBSKRYBUJACYCH) OR ("WIDOCZNY_DLA_SUBSKRYBUJACYCH" IS NULL AND :oWIDOCZNY_DLA_SUBSKRYBUJACYCH IS NULL)) AND (("WALUTA" = :oWALUTA) OR ("WALUTA" IS NULL AND :oWALUTA IS NULL))'

     

     

    InsertCommand='INSERT INTO "V_WEB_F_PROJEKTY_KLIENTOW" ("NAZWA_PROJEKTU", "OPIS_PROJEKTU", "PREFEROWANA_DATA_STARTU", "NAZWA_FAZY", "WYMAGANA_KWOTA_INWESTYCJI", "NAZWA_BRANZY", "OCZEKIWANY_ZYSK_CALKOWITY", "WIDOCZNY_DLA_SUBSKRYBUJACYCH", "WALUTA", "FK_KLIENTA") VALUES (:NAZWA_PROJEKTU, :OPIS_PROJEKTU, :PREFEROWANA_DATA_STARTU, :FAZA_USLUGA, :WYMAGANA_KWOTA_INWESTYCJI, :SEKTOR, :OCZEKIWANY_ZYSK_CALKOWITY, :WIDOCZNY_DLA_SUBSKRYBUJACYCH, :WALUTA, :FK_KLIENTA)'

     

     

    OldValuesParameterFormatString="o{0}" ProviderName="<%$ ConnectionStrings:UserProjectsConnectionString.ProviderName %>"

     

     

    SelectCommand='SELECT "ID", "NAZWA_PROJEKTU", "OPIS_PROJEKTU", "PREFEROWANA_DATA_STARTU", "NAZWA_FAZY" FAZA_USLUGA, "WYMAGANA_KWOTA_INWESTYCJI", "NAZWA_BRANZY" SEKTOR, "OCZEKIWANY_ZYSK_CALKOWITY", "WIDOCZNY_DLA_SUBSKRYBUJACYCH", "WALUTA" FROM "V_WEB_F_PROJEKTY_KLIENTOW" WHERE ("FK_KLIENTA" = :FK_KLIENTA)'

     

     

     

    UpdateCommand='UPDATE "WEB_F_PROJEKTY" SET "NAZWA_PROJEKTU" = :NAZWA_PROJEKTU, "OPIS_PROJEKTU" = :OPIS_PROJEKTU, "PREFEROWANA_DATA_STARTU" = :PREFEROWANA_DATA_STARTU, "FAZA_USLUGA" = :FAZA_USLUGA, "WYMAGANA_KWOTA_INWESTYCJI" = :WYMAGANA_KWOTA_INWESTYCJI, "SEKTOR" = :SEKTOR, "OCZEKIWANY_ZYSK_CALKOWITY" = :OCZEKIWANY_ZYSK_CALKOWITY, "WIDOCZNY_DLA_SUBSKRYBUJACYCH" = :WIDOCZNY_DLA_SUBSKRYBUJACYCH, "WALUTA" = :WALUTA WHERE "ID" = :oID OR (("NAZWA_PROJEKTU" = :oNAZWA_PROJEKTU) OR ("NAZWA_PROJEKTU" IS NULL AND :oNAZWA_PROJEKTU IS NULL)) AND (("OPIS_PROJEKTU" = :oOPIS_PROJEKTU) OR ("OPIS_PROJEKTU" IS NULL AND :oOPIS_PROJEKTU IS NULL)) AND (("PREFEROWANA_DATA_STARTU" = :oPREFEROWANA_DATA_STARTU) OR ("PREFEROWANA_DATA_STARTU" IS NULL AND :oPREFEROWANA_DATA_STARTU IS NULL)) AND (("FAZA_USLUGA" = :oFAZA_USLUGA) OR ("FAZA_USLUGA" IS NULL AND :oFAZA_USLUGA IS NULL)) AND (("WYMAGANA_KWOTA_INWESTYCJI" = :oWYMAGANA_KWOTA_INWESTYCJI) OR ("WYMAGANA_KWOTA_INWESTYCJI" IS NULL AND :oWYMAGANA_KWOTA_INWESTYCJI IS NULL)) AND (("SEKTOR" = :oSEKTOR) OR ("SEKTOR" IS NULL AND :oSEKTOR IS NULL)) AND (("OCZEKIWANY_ZYSK_CALKOWITY" = :oOCZEKIWANY_ZYSK_CALKOWITY) OR ("OCZEKIWANY_ZYSK_CALKOWITY" IS NULL AND :oOCZEKIWANY_ZYSK_CALKOWITY IS NULL)) AND (("WIDOCZNY_DLA_SUBSKRYBUJACYCH" = :oWIDOCZNY_DLA_SUBSKRYBUJACYCH) OR ("WIDOCZNY_DLA_SUBSKRYBUJACYCH" IS NULL AND :oWIDOCZNY_DLA_SUBSKRYBUJACYCH IS NULL)) AND (("WALUTA" = :oWALUTA) OR ("WALUTA" IS NULL AND :oWALUTA IS NULL))'>

     

     

     

    <SelectParameters>

     

     

    <asp:SessionParameter DefaultValue="8966" Name="FK_KLIENTA" SessionField="clientId" Type="Decimal" />

     

     

    </SelectParameters>

     

     

    <DeleteParameters>

     

     

    <asp:Parameter Name="oID" Type="Decimal" />

     

     

    <asp:Parameter Name="oNAZWA_PROJEKTU" Type="String" />

     

     

    <asp:Parameter Name="oOPIS_PROJEKTU" Type="String" />

     

     

    <asp:Parameter Name="oPREFEROWANA_DATA_STARTU" Type="DateTime" />

     

     

    <asp:Parameter Name="oFAZA_USLUGA" Type="Decimal" />

     

     

    <asp:Parameter Name="oWYMAGANA_KWOTA_INWESTYCJI" Type="Decimal" />

     

     

    <asp:Parameter Name="oSEKTOR" Type="Decimal" />

     

     

    <asp:Parameter Name="oOCZEKIWANY_ZYSK_CALKOWITY" Type="Decimal" />

     

     

    <asp:Parameter Name="oWIDOCZNY_DLA_SUBSKRYBUJACYCH" Type="Decimal" />

     

     

    <asp:Parameter Name="oWALUTA" Type="String" />

     

     

    </DeleteParameters>

     

     

    <UpdateParameters>

     

     

    <asp:Parameter Name="NAZWA_PROJEKTU" Type="String" />

     

     

    <asp:Parameter Name="OPIS_PROJEKTU" Type="String" />

     

     

    <asp:Parameter Name="PREFEROWANA_DATA_STARTU" Type="DateTime" />

     

     

    <asp:Parameter Name="FAZA_USLUGA" Type="Decimal" />

     

     

    <asp:Parameter Name="WYMAGANA_KWOTA_INWESTYCJI" Type="Decimal" />

     

     

    <asp:Parameter Name="SEKTOR" Type="Decimal" />

     

     

    <asp:Parameter Name="OCZEKIWANY_ZYSK_CALKOWITY" Type="Decimal" />

     

     

    <asp:Parameter Name="WIDOCZNY_DLA_SUBSKRYBUJACYCH" Type="Decimal" />

     

     

    <asp:Parameter Name="WALUTA" Type="String" />

     

     

    <asp:Parameter Name="oID" Type="Decimal" />

     

     

    <asp:Parameter Name="oNAZWA_PROJEKTU" Type="String" />

     

     

    <asp:Parameter Name="oOPIS_PROJEKTU" Type="String" />

     

     

    <asp:Parameter Name="oPREFEROWANA_DATA_STARTU" Type="DateTime" />

     

     

    <asp:Parameter Name="oFAZA_USLUGA" Type="Decimal" />

     

     

    <asp:Parameter Name="oWYMAGANA_KWOTA_INWESTYCJI" Type="Decimal" />

     

     

    <asp:Parameter Name="oSEKTOR" Type="Decimal" />

     

     

    <asp:Parameter Name="oOCZEKIWANY_ZYSK_CALKOWITY" Type="Decimal" />

     

     

    <asp:Parameter Name="oWIDOCZNY_DLA_SUBSKRYBUJACYCH" Type="Decimal" />

     

     

    <asp:Parameter Name="oWALUTA" Type="String" />

     

     

    </UpdateParameters>

     

     

    <InsertParameters>

     

     

    <asp:Parameter Name="NAZWA_PROJEKTU" Type="String" />

     

     

    <asp:Parameter Name="OPIS_PROJEKTU" Type="String" />

     

     

    <asp:Parameter Name="PREFEROWANA_DATA_STARTU" Type="DateTime" />

     

     

    <asp:Parameter Name="FAZA_USLUGA" Type="Decimal" />

     

     

    <asp:Parameter Name="WYMAGANA_KWOTA_INWESTYCJI" Type="Decimal" />

     

     

    <asp:Parameter Name="SEKTOR" Type="Decimal" />

     

     

    <asp:Parameter Name="OCZEKIWANY_ZYSK_CALKOWITY" Type="Decimal" />

     

     

    <asp:Parameter Name="WIDOCZNY_DLA_SUBSKRYBUJACYCH" Type="Decimal" />

     

     

    <asp:Parameter Name="WALUTA" Type="String" />

     

     

    <asp:SessionParameter DefaultValue="8966" Name="FK_KLIENTA" SessionField="clientId" Type="Decimal" />

     

     

    </InsertParameters>

     

     

    </asp:SqlDataSource>

     

     

    <telerik:GridHTMLEditorColumnEditor ID="GridTextBoxColumnEditor1" runat="server">

     

     

    </telerik:GridHTMLEditorColumnEditor>

     

     

    <telerik:GridTextBoxColumnEditor id="TextEditor1" runat="server">

     

     

    <TextBoxStyle Height="100" />

     

    </

     

    telerik:GridTextBoxColumnEditor>

     

     

    &nbsp;

     

     

    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:DevPhasesConnectionString %>"

     

     

    ProviderName="<%$ ConnectionStrings:DevPhasesConnectionString.ProviderName %>"

     

     

    SelectCommand='SELECT "ID", "NAZWA_FAZY" FROM "WEB_F_SLO_FAZ" ORDER BY "KOLEJNOSC"'></asp:SqlDataSource>

     

     

    <asp:SqlDataSource ID="UserProjectsCon" runat="server" ConnectionString="<%$ ConnectionStrings:UserProjectsConnectionString %>"

     

     

    ProviderName="<%$ ConnectionStrings:UserProjectsConnectionString.ProviderName %>"

     

     

    SelectCommand='SELECT "ID", "NAZWA_PROJEKTU", "OPIS_PROJEKTU", "PREFEROWANA_DATA_STARTU", "FAZA_USLUGA", "SEKTOR", "OCZEKIWANY_ZYSK_CALKOWITY", "WIDOCZNY_DLA_SUBSKRYBUJACYCH", "WALUTA" FROM "WEB_F_PROJEKTY"'

     

     

    OldValuesParameterFormatString="o{0}" ConflictDetection="CompareAllValues"

     

     

    InsertCommand='INSERT INTO "WEB_F_PROJEKTY" ("ID", "NAZWA_PROJEKTU", "OPIS_PROJEKTU", "PREFEROWANA_DATA_STARTU", "FAZA_USLUGA", "SEKTOR", "OCZEKIWANY_ZYSK_CALKOWITY", "WIDOCZNY_DLA_SUBSKRYBUJACYCH", "WALUTA") VALUES (:ID, :NAZWA_PROJEKTU, :OPIS_PROJEKTU, :PREFEROWANA_DATA_STARTU, :FAZA_USLUGA, :SEKTOR, :OCZEKIWANY_ZYSK_CALKOWITY, :WIDOCZNY_DLA_SUBSKRYBUJACYCH, :WALUTA)' DeleteCommand='DELETE FROM "WEB_F_PROJEKTY" WHERE "ID" = :oID AND (("NAZWA_PROJEKTU" = :oNAZWA_PROJEKTU) OR ("NAZWA_PROJEKTU" IS NULL AND :oNAZWA_PROJEKTU IS NULL)) AND (("OPIS_PROJEKTU" = :oOPIS_PROJEKTU) OR ("OPIS_PROJEKTU" IS NULL AND :oOPIS_PROJEKTU IS NULL)) AND (("PREFEROWANA_DATA_STARTU" = :oPREFEROWANA_DATA_STARTU) OR ("PREFEROWANA_DATA_STARTU" IS NULL AND :oPREFEROWANA_DATA_STARTU IS NULL)) AND (("FAZA_USLUGA" = :oFAZA_USLUGA) OR ("FAZA_USLUGA" IS NULL AND :oFAZA_USLUGA IS NULL)) AND (("SEKTOR" = :oSEKTOR) OR ("SEKTOR" IS NULL AND :oSEKTOR IS NULL)) AND (("OCZEKIWANY_ZYSK_CALKOWITY" = :oOCZEKIWANY_ZYSK_CALKOWITY) OR ("OCZEKIWANY_ZYSK_CALKOWITY" IS NULL AND :oOCZEKIWANY_ZYSK_CALKOWITY IS NULL)) AND (("WIDOCZNY_DLA_SUBSKRYBUJACYCH" = :oWIDOCZNY_DLA_SUBSKRYBUJACYCH) OR ("WIDOCZNY_DLA_SUBSKRYBUJACYCH" IS NULL AND :oWIDOCZNY_DLA_SUBSKRYBUJACYCH IS NULL)) AND (("WALUTA" = :oWALUTA) OR ("WALUTA" IS NULL AND :oWALUTA IS NULL))' UpdateCommand='UPDATE "WEB_F_PROJEKTY" SET "NAZWA_PROJEKTU" = :NAZWA_PROJEKTU, "OPIS_PROJEKTU" = :OPIS_PROJEKTU, "PREFEROWANA_DATA_STARTU" = :PREFEROWANA_DATA_STARTU, "FAZA_USLUGA" = :FAZA_USLUGA, "SEKTOR" = :SEKTOR, "OCZEKIWANY_ZYSK_CALKOWITY" = :OCZEKIWANY_ZYSK_CALKOWITY, "WIDOCZNY_DLA_SUBSKRYBUJACYCH" = :WIDOCZNY_DLA_SUBSKRYBUJACYCH, "WALUTA" = :WALUTA WHERE "ID" = :oID AND (("NAZWA_PROJEKTU" = :oNAZWA_PROJEKTU) OR ("NAZWA_PROJEKTU" IS NULL AND :oNAZWA_PROJEKTU IS NULL)) AND (("OPIS_PROJEKTU" = :oOPIS_PROJEKTU) OR ("OPIS_PROJEKTU" IS NULL AND :oOPIS_PROJEKTU IS NULL)) AND (("PREFEROWANA_DATA_STARTU" = :oPREFEROWANA_DATA_STARTU) OR ("PREFEROWANA_DATA_STARTU" IS NULL AND :oPREFEROWANA_DATA_STARTU IS NULL)) AND (("FAZA_USLUGA" = :oFAZA_USLUGA) OR ("FAZA_USLUGA" IS NULL AND :oFAZA_USLUGA IS NULL)) AND (("SEKTOR" = :oSEKTOR) OR ("SEKTOR" IS NULL AND :oSEKTOR IS NULL)) AND (("OCZEKIWANY_ZYSK_CALKOWITY" = :oOCZEKIWANY_ZYSK_CALKOWITY) OR ("OCZEKIWANY_ZYSK_CALKOWITY" IS NULL AND :oOCZEKIWANY_ZYSK_CALKOWITY IS NULL)) AND (("WIDOCZNY_DLA_SUBSKRYBUJACYCH" = :oWIDOCZNY_DLA_SUBSKRYBUJACYCH) OR ("WIDOCZNY_DLA_SUBSKRYBUJACYCH" IS NULL AND :oWIDOCZNY_DLA_SUBSKRYBUJACYCH IS NULL)) AND (("WALUTA" = :oWALUTA) OR ("WALUTA" IS NULL AND :oWALUTA IS NULL))'>

     

     

    <InsertParameters>

     

     

    <asp:Parameter Name="ID" Type="Decimal" />

     

     

    <asp:Parameter Name="NAZWA_PROJEKTU" Type="String" />

     

     

    <asp:Parameter Name="OPIS_PROJEKTU" Type="String" />

     

     

    <asp:Parameter Name="PREFEROWANA_DATA_STARTU" Type="DateTime" />

     

     

    <asp:Parameter Name="FAZA_USLUGA" Type="Decimal" />

     

     

    <asp:Parameter Name="SEKTOR" Type="Decimal" />

     

     

    <asp:Parameter Name="OCZEKIWANY_ZYSK_CALKOWITY" Type="Decimal" />

     

     

    <asp:Parameter Name="WIDOCZNY_DLA_SUBSKRYBUJACYCH" Type="Decimal" />

     

     

    <asp:Parameter Name="WALUTA" Type="String" />

     

     

    </InsertParameters>

     

     

    <DeleteParameters>

     

     

    <asp:Parameter Name="oID" Type="Decimal" />

     

     

    <asp:Parameter Name="oNAZWA_PROJEKTU" Type="String" />

     

     

    <asp:Parameter Name="oOPIS_PROJEKTU" Type="String" />

     

     

    <asp:Parameter Name="oPREFEROWANA_DATA_STARTU" Type="DateTime" />

     

     

    <asp:Parameter Name="oFAZA_USLUGA" Type="Decimal" />

     

     

    <asp:Parameter Name="oSEKTOR" Type="Decimal" />

     

     

    <asp:Parameter Name="oOCZEKIWANY_ZYSK_CALKOWITY" Type="Decimal" />

     

     

    <asp:Parameter Name="oWIDOCZNY_DLA_SUBSKRYBUJACYCH" Type="Decimal" />

     

     

    <asp:Parameter Name="oWALUTA" Type="String" />

     

     

    </DeleteParameters>

     

     

    <UpdateParameters>

     

     

    <asp:Parameter Name="NAZWA_PROJEKTU" Type="String" />

     

     

    <asp:Parameter Name="OPIS_PROJEKTU" Type="String" />

     

     

    <asp:Parameter Name="PREFEROWANA_DATA_STARTU" Type="DateTime" />

     

     

    <asp:Parameter Name="FAZA_USLUGA" Type="Decimal" />

     

     

    <asp:Parameter Name="SEKTOR" Type="Decimal" />

     

     

    <asp:Parameter Name="OCZEKIWANY_ZYSK_CALKOWITY" Type="Decimal" />

     

     

    <asp:Parameter Name="WIDOCZNY_DLA_SUBSKRYBUJACYCH" Type="Decimal" />

     

     

    <asp:Parameter Name="WALUTA" Type="String" />

     

     

    <asp:Parameter Name="oID" Type="Decimal" />

     

     

    <asp:Parameter Name="oNAZWA_PROJEKTU" Type="String" />

     

     

    <asp:Parameter Name="oOPIS_PROJEKTU" Type="String" />

     

     

    <asp:Parameter Name="oPREFEROWANA_DATA_STARTU" Type="DateTime" />

     

     

    <asp:Parameter Name="oFAZA_USLUGA" Type="Decimal" />

     

     

    <asp:Parameter Name="oSEKTOR" Type="Decimal" />

     

     

    <asp:Parameter Name="oOCZEKIWANY_ZYSK_CALKOWITY" Type="Decimal" />

     

     

    <asp:Parameter Name="oWIDOCZNY_DLA_SUBSKRYBUJACYCH" Type="Decimal" />

     

     

    <asp:Parameter Name="oWALUTA" Type="String" />

     

     

    </UpdateParameters>

     

     

    </asp:SqlDataSource>

     

     

    &nbsp;

     

     

    <telerik:GridHTMLEditorColumnEditor ID="GridHTMLEditorColumnEditor1" runat="server">

     

     

    <Editor ID="Editor1" runat="server" EditModes="Design" Width="200px">

     

     

    <Content>

     

    </

     

    Content>

     

     

    </Editor>

     

     

    </telerik:GridHTMLEditorColumnEditor>&nbsp;&nbsp;

     

     

    <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:SectorsConnectionString %>"

     

     

    ProviderName="<%$ ConnectionStrings:SectorsConnectionString.ProviderName %>"

     

     

    SelectCommand='SELECT "ID", "NAZWA_BRANZY" FROM "WEB_F_SLO_BRANZ" ORDER BY "NAZWA_BRANZY"'></asp:SqlDataSource>

     

     

    <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:CountriesConnectionString %>"

     

     

    ProviderName="<%$ ConnectionStrings:CountriesConnectionString.ProviderName %>"

     

     

    SelectCommand='SELECT "WALUTA" FROM "SLO_WALUT" ORDER BY "WALUTA"'></asp:SqlDataSource>

     

     

    <asp:SqlDataSource ID="SqlDataSource4" runat="server" ConnectionString="<%$ ConnectionStrings:ProjFundConnectionString %>"

     

     

    ProviderName="<%$ ConnectionStrings:ProjFundConnectionString.ProviderName %>"

     

     

    OldValuesParameterFormatString="original_{0}"

     

     

    SelectCommand='SELECT ID, FUNDUSZ, KRAJ, MIASTO, FK_PROJEKTU FROM V_WEB_F_PROJEKTY_FUNDUSZY WHERE FK_PROJEKTU = :FK_PROJEKTU' ConflictDetection="CompareAllValues"

     

     

    DeleteCommand='DELETE FROM V_WEB_F_PROJEKTY_FUNDUSZY WHERE ID = :original_ID AND :original_FUNDUSZ = :original_FUNDUSZ AND :original_KRAJ = :original_KRAJ AND :original_MIASTO = :original_MIASTO AND FK_PROJEKTU = :original_FK_PROJEKTU'>

     

     

    <SelectParameters>

     

     

    <asp:SessionParameter Name="FK_PROJEKTU" SessionField="FK_PROJEKTU" Type="decimal" />

     

     

    </SelectParameters>

     

     

    <DeleteParameters>

     

     

    <asp:Parameter Name="original_ID" Type="Decimal" />

     

     

    <asp:Parameter Name="original_FUNDUSZ" Type="String" />

     

     

    <asp:Parameter Name="original_KRAJ" Type="String" />

     

     

    <asp:Parameter Name="original_MIASTO" Type="String" />

     

     

    <asp:Parameter Name="original_FK_PROJEKTU" Type="Decimal" />

     

     

    </DeleteParameters>

     

     

    </asp:SqlDataSource>

     

     

     

    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" Skin="Office2007">

     

     

    </telerik:RadSkinManager>

     

     


    ascx.cs:

    using

     

    System;

     

    using

     

    System.Data;

     

    using

     

    System.Configuration;

     

    using

     

    System.Collections;

     

    using

     

    System.Web;

     

    using

     

    System.Web.Security;

     

    using

     

    System.Web.UI;

     

    using

     

    System.Web.UI.WebControls;

     

    using

     

    System.Web.UI.WebControls.WebParts;

     

    using

     

    System.Web.UI.HtmlControls;

     

    using

     

    Telerik.Web.UI;

     

    public

     

    partial class ClientsFundsAndProjects : System.Web.UI.UserControl

     

    {

     

    DatabaseHandler dh = new DatabaseHandler();

     

     

    //string companyId = "8150";

     

     

    string clientId = "8966";

     

     

    protected void Page_Load(object sender, EventArgs e)

     

    {

     

    try

     

    {

     

    //companyId = Session["companyId"].ToString();

     

    clientId = Session[

    "clientId"].ToString();

     

     

    string eventArgs = Request.Params.Get("__EVENTARGUMENT");

     

    RaisePostBackEvent(eventArgs);

    }

     

    catch (Exception ex)

     

    {

    dh.LogError(

    "ClientsFundsAndProjects.Page_Load", ex.Message);

     

    }

    }

     

    protected void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)

     

    {

     

    //Create Expand/Collapse button for each table view

     

     

    //CreateExpandCollapseButton(e.Item, "EmployeeID");

     

     

    //Hide headers without MasterTableView's header

     

     

    /*if (e.Item is GridHeaderItem && e.Item.OwnerTableView != RadGrid1.MasterTableView)

     

    {

    //e.Item.Style["display"] = "none";

    }

    if (e.Item is GridNestedViewItem)

    {

    //e.Item.Cells[0].Visible = false;

    }*/

     

    try

     

    {

     

    if (!IsPostBack)

     

     

    if (e.Item is GridDataItem)

     

    {

     

    HyperLink mapLink = (HyperLink)e.Item.FindControl("FundLocationMap");

     

    mapLink.Attributes[

    "href"] = "#";

     

    mapLink.Attributes[

    "onclick"] = String.Format("return ShowMap('{0}','{1}');", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["ID"], e.Item.ItemIndex);

     

     

    HyperLink locationLink = (HyperLink)e.Item.FindControl("FundDetailsLink");

     

    locationLink.Attributes[

    "href"] = "#";

     

    locationLink.Attributes[

    "onclick"] = String.Format("return ShowDetails('{0}','{1}');", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["ID"], e.Item.ItemIndex);

     

    }

    e.Item.Expanded =

    false;

     

    }

     

    catch (Exception ex)

     

    {

    dh.LogError(

    "ClientsFundsAndProjects.RadGrid1_ItemCreated", ex.Message);

     

    }

    }

     

    protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)

     

    {

     

    try

     

    {

     

    string sql = "SELECT \"Fundusz\" ID, \"Nazwa Funduszu\", \"Kraj\", \"Telefon\" FROM V_WEB_F_DANE_FUNDUSZY WHERE \"Fundusz\" IN ";

     

    sql +=

    "(SELECT FK_FUNDUSZU FROM WEB_F_FUNDUSZE_KLIENTOW WHERE FK_KLIENTA = " + clientId + ")";

     

    RadGrid1.DataSource = dh.ExecuteSqlAllRows(sql);

    }

     

    catch (Exception ex)

     

    {

    dh.LogError(

    "ClientsFundsAndProjects.RadGrid1_NeedDataSource", ex.Message);

     

    }

    }

     

    protected void RadGrid2_ItemDeleted(object source, GridDeletedEventArgs e)

     

    {

     

     

    if (e.Exception != null)

     

    {

    e.ExceptionHandled =

    true;

     

    SetMessage(

    "Project cannot be deleted. Reason: " + e.Exception.Message);

     

    }

     

    else

     

    {

    SetMessage(

    "New project was deleted!");

     

     

    //when a project is removed from fund(s), then we need to remove a person registered in funds (in company -> FIRMA)

     

     

    GridDataItem item = (GridDataItem)e.Item;

     

     

    if (item.OwnerTableView.Name == "FundsForProjects")//if only a project is removed from fund

     

    {

     

    //handle deleting from WEB_F_PROJEKTY_FUNDUSZY!!!

     

     

    int fundId = Int32.Parse(item["ID"].Text);

     

    dh.DeleteClientPerson(fundId,

    Int32.Parse(clientId));

     

    }

     

    else if (item.OwnerTableView.Name == "Projects")//if whole project is removed (so also removed from all funds, applied to previously)

     

    {

     

    foreach (GridDataItem everyItem in RadGrid2.Items)

     

    {

     

    if (everyItem.OwnerTableView.ParentItem == item)

     

    {

     

    //handle deleting from WEB_F_PROJEKTY_FUNDUSZY!!!

     

     

    int fundId = Int32.Parse(everyItem["ID"].Text);

     

    dh.DeleteClientPerson(fundId,

    Int32.Parse(clientId));

     

    }

    }

    }

    }

    }

     

    protected void RadGrid2_ItemInserted(object source, GridInsertedEventArgs e)

     

    {

     

    if (e.Exception != null)

     

    {

    e.ExceptionHandled =

    true;

     

    SetMessage(

    "Project cannot be inserted. Reason: " + e.Exception.Message);

     

    }

     

    else

     

    {

    SetMessage(

    "New project is inserted!");

     

    }

    }

     

    protected void RadGrid2_ItemUpdated(object source, GridUpdatedEventArgs e)

     

    {

     

    if (e.Exception != null)

     

    {

    e.ExceptionHandled =

    true;

     

    SetMessage(

    "Project cannot be updated. Reason: " + e.Exception.Message);

     

    }

     

    else

     

    {

    SetMessage(

    "New project is updated!");

     

    }

    }

     

    protected void RadGrid2_ItemCreated(object sender, GridItemEventArgs e)

     

    {

     

    try

     

    {

     

    if (e.Item is GridEditableItem && e.Item.IsInEditMode)

     

    {

     

    RadEditor rade = (e.Item as GridEditableItem)["OPIS_PROJEKTU"].Controls[0] as RadEditor;

     

    rade.Width =

    Unit.Point(250);

     

    rade.Height =

    Unit.Point(200);

     

     

    //rade.ToolbarMode = EditorToolbarMode.ShowOnFocus;

     

     

    //rade.EnableEmbeddedBaseStylesheet = true;

     

    rade.EditModes =

    EditModes.Design;

     

    }

    }

     

    catch (Exception ex)

     

    {

    dh.LogError(

    "ClientsFundsAndProjects.RadGrid2_ItemCreated", ex.Message);

     

    }

    }

     

    private void DisplayMessage(string text)

     

    {

    RadGrid1.Controls.Add(

    new LiteralControl(string.Format("<span style='color:red'>{0}</span>", text)));

     

    }

     

    private void SetMessage(string message)

     

    {

    gridMessage = message;

    }

     

    private string gridMessage = null;

     

     

     

    protected void RadGrid1_DataBound(object sender, EventArgs e)

     

    {

     

    if (!string.IsNullOrEmpty(gridMessage))

     

    {

    DisplayMessage(gridMessage);

    }

    }

     

    public void RaisePostBackEvent(string eventArgument)

     

    {

     

    //RadGrid grid = (RadGrid)sourceControl;

     

     

    if (eventArgument == null) return;

     

     

    if (eventArgument.Contains("RadGrid2_"))

     

    {

    eventArgument = eventArgument.Replace(

    "RadGrid2_", "");

     

     

    RadGrid grid = RadGrid2;

     

     

    string[] fundsAndProcessesArray = eventArgument.Split(new string[]{"***"}, StringSplitOptions.RemoveEmptyEntries);

     

     

    string[] selectedProcessesArray = fundsAndProcessesArray[1].Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);

     

     

    string[] selectedFundsArray = fundsAndProcessesArray[0].Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);

     

     

    GridItemCollection itemCollection = grid.SelectedItems;

     

     

    foreach (GridDataItem item in itemCollection)

     

    {

     

    if (item.OwnerTableView.Name == "Projects")

     

    {

     

    string projectId = item["ID"].Text;

     

    dh.InsertProjectFunds(projectId, selectedFundsArray, selectedProcessesArray);

    }

    }

    grid.RaisePostBackEvent(eventArgument);

    grid.Rebind();

    }

     

    else if (eventArgument.Contains("RadGrid1_"))

     

    {

    eventArgument = eventArgument.Replace(

    "RadGrid1_", "");

     

     

    RadGrid grid = RadGrid1;

     

     

    string[] selectedFundsArray = eventArgument.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);

     

    dh.DeleteClientFunds(clientId, selectedFundsArray);

    grid.RaisePostBackEvent(eventArgument);

    grid.Rebind();

    }

     

    //base.RaisePostBackEvent(sourceControl, eventArgument);

     

    }

     

    protected void Button3_Click(object sender, EventArgs e)

     

    {

    Response.Redirect(

    "./FundSearchingCriteria.aspx");

     

    }

     

    protected void Button4_Click(object sender, EventArgs e)

     

    {

     

    if (Session["clientId"] == null)

     

    {

    Session.Add(

    "clientId", clientId);

     

    }

     

    else

     

    {

    Session[

    "clientId"] = clientId;

     

    }

    Response.Redirect(

    "./ProcesesOperations.aspx");

     

    }

     

     

    protected void Button5_Click(object sender, EventArgs e)

     

    {

     

    RadGrid grid = RadGrid1;

     

     

    //grid.Rebind();

     

    }

    }


  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    19 Sep 2016
    05 Mar 2010
    Link to this post
    Hello Pawel,

    From the data you provide I cannot tell you what the problem is. You could check whether there are any js errors thrown from the ajax. You could try to stop the Ajax to see whether some of the problems will disappear (EnableAjax = false). Also you should use RadAjaxManagerProxy in the master page.

    All the best,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  5. Pawel
    Pawel avatar
    12 posts
    Registered:
    02 Jan 2008
    05 Mar 2010
    Link to this post
    Hi.
    I changed my control to make it independent of specific database structures, so you could load it to sitefinity on your site and diagnose the problem.
    It only requires Oracle database and connection string "UserProjectsConnectionString" (to any user, other structures are not important as I use DUAL for simulating data), defined in web config:
    e.g.

    <

     

    add name="UserProjectsConnectionString" connectionString="Data Source=localhost;User ID=xxx;Password=xxx;Unicode=True" providerName="System.Data.OracleClient"/>

     

    How can I attach/send code for you (I don't want to copy/paste it as it takes to much place and is difficult for reading; additionally attachments are only graphical files)?
    Please let me know how can I provide you attched ascx and ascx.cs code for diagnosis, and I will send it.
    I hope then it will be easier to diagnose a problem.
    Greetings:
    Pawel
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    19 Sep 2016
    08 Mar 2010
    Link to this post
    Hello Pawel,

    You can try attaching a zip or provide me with an external link from where I could download the files and datasource.

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Register for webinar
6 posts, 0 answered