Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
177 views
Hi Telerik,
         We are facing UI related issue in Radgrid with Edit Template, When we are scrolling down the List box in edit Template is get flickered.
Pleas efind tghe below UI for reference. Please reply ASAP as it is urgent.

 

<table border="0" cellpadding="0" cellspacing="0" align="left" style="width: 1024px; table-layout:fixed; ">

 

 

<tr>

 

 

<td>

 

 

 

<telerik:RadGrid ID="dgrAltDisposition" HeaderStyle-Font-Underline="true" Width="1024px"

 

 

AutoGenerateColumns="False" OnNeedDataSource="dgrAltDisposition_NeedDataSource"

 

 

AllowFilteringByColumn="false" AllowSorting="false" AllowMultiRowSelection="false"

 

 

runat="server" MasterTableView-CommandItemSettings-ShowRefreshButton="true" HeaderStyle-HorizontalAlign="Center"

 

 

HeaderStyle-VerticalAlign="Top" ItemStyle-HorizontalAlign="Center" BackColor="#EFF7FF"

 

 

Skin="Office2007" ShowGroupPanel="false" GridLines="None" AllowAutomaticInserts="false"

 

 

AllowAutomaticUpdates="false" AllowCustomPaging="false" AllowAutomaticDeletes="false"

 

 

EnableAJAXLoadingTemplate="true" EnableAJAX="true" OnItemDataBound="dgrAltDisposition_ItemDataBound"

 

 

OnDeleteCommand="dgrAltDisposition_DeleteCommand" OnInsertCommand="dgrAltDisposition_InsertCommand"

 

 

OnUpdateCommand="dgrAltDisposition_UpdateCommand">

 

 

<ItemStyle HorizontalAlign="Center" />

 

<%

-- <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Office2007">

 

</HeaderContextMenu>--

 

%>

 

 

<AlternatingItemStyle HorizontalAlign="Left" />

 

 

<HeaderStyle Font-Underline="True" HorizontalAlign="Center" VerticalAlign="Top" />

 

 

<GroupingSettings CaseSensitive="false" />

 

 

<FilterMenu EnableImageSprites="False">

 

 

</FilterMenu>

 

 

<MasterTableView DataKeyNames="CAF_AFF_AIR_ALTER_DISP_ID" CommandItemDisplay="Top"

 

 

Name="MTV_AltDisposition" AllowMultiColumnSorting="true" HorizontalAlign="NotSet"

 

 

Width="1024px" CommandItemSettings-ShowRefreshButton="false" AutoGenerateColumns="False"

 

 

ShowFooter="false" GridLines="Both" GroupLoadMode="Client" TableLayout="Fixed"

 

 

ShowHeader="true" InsertItemPageIndexAction="ShowItemOnFirstPage" AlternatingItemStyle-BorderStyle="None">

 

 

<NoRecordsTemplate>

 

 

<center>

 

 

<span class="clsTableCellCenter"><b>Sorry,there is no matching data available for display.</b></span>

 

 

</center>

 

 

</NoRecordsTemplate>

 

 

<CommandItemSettings AddNewRecordText="Add Alternate Disposition" />

 

 

<ItemStyle HorizontalAlign="Left" Font-Size="8pt" ForeColor="Black" Font-Names="Arial"

 

 

VerticalAlign="Middle" />

 

 

<AlternatingItemStyle BorderStyle="None" />

 

 

<HeaderStyle HorizontalAlign="Center" Font-Size="8pt" />

 

 

<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">

 

 

</RowIndicatorColumn>

 

 

<ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">

 

 

</ExpandCollapseColumn>

 

 

<Columns>

 

 

<telerik:GridEditCommandColumn ButtonType="LinkButton" EditText="Edit" UniqueName="EditCommandColumn"

 

 

HeaderText="" HeaderStyle-HorizontalAlign="Center">

 

 

<HeaderStyle HorizontalAlign="Center" Width="30px" />

 

 

<ItemStyle Font-Size="8pt" HorizontalAlign="Center" ForeColor="Blue" />

 

 

</telerik:GridEditCommandColumn>

 

 

<telerik:GridBoundColumn UniqueName="Alternate_Disposition_ID" HeaderText="Alternate Disposition ID"

 

 

DataField="CAF_AFF_AIR_ALTER_DISP_ID" SortExpression="CAF_AFF_AIR_ALTER_DISP_ID"

 

 

Visible="false" HeaderStyle-HorizontalAlign="Center" ShowFilterIcon="false" AllowFiltering="false"

 

 

ItemStyle-HorizontalAlign="Left">

 

 

<ItemStyle Font-Size="8pt" HorizontalAlign="Left" />

 

 

<HeaderStyle Font-Size="8pt" HorizontalAlign="Center" Font-Underline="false" />

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn UniqueName="Affected_AirplaneList" HeaderText="Affected on Airplane(s)"

 

 

DataField="AFFECTED_AIRPLANELIST" SortExpression="AFFECTED_AIRPLANELIST" Visible="true"

 

 

HeaderStyle-HorizontalAlign="Center" ShowFilterIcon="false" AllowFiltering="false"

 

 

ItemStyle-HorizontalAlign="Left">

 

 

<ItemStyle Font-Size="8pt" HorizontalAlign="Left" Width="50px" />

 

 

<HeaderStyle Font-Size="8pt" HorizontalAlign="Center" Font-Underline="false" Width="50px" />

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridTemplateColumn UniqueName="reason_for_alter_dispo" HeaderText="Reason for Alternate Disposition"

 

 

DataField="REASON_FOR_ALTER_DISPO_1" SortExpression="REASON_FOR_ALTER_DISPO_1"

 

 

Visible="true" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left">

 

 

<ItemTemplate>

 

 

<table border="0" style="border-style: none;">

 

 

<tr>

 

 

<td style="border-style: none; font-size: 8pt;" align="left">

 

 

<asp:Label runat="server" ID="lblReason_for_Alternate_Disposition" align="left" Text='<%# ValidateString(DataBinder.Eval(Container.DataItem, "REASON_FOR_ALTER_DISPO_1") + "" + DataBinder.Eval(Container.DataItem, "REASON_FOR_ALTER_DISPO_2"))%>'></asp:Label>

 

 

</td>

 

 

<td style="border-style: none; text-align: right;" align="right">

 

 

<asp:ImageButton ID="ibtnReason_for_Alternate_Disposition" runat="server" OnClientClick="javascript:fnExpandW(this,'reason_for_alter_dispo')"

 

 

ImageUrl="~/IMAGES/btn_Dots.GIF" ImageAlign="Right" /><asp:HiddenField ID="hdnReason_for_Alternate_Disposition"

 

 

runat="server" Value='<%# DataBinder.Eval(Container.DataItem, "REASON_FOR_ALTER_DISPO_1") + "" + DataBinder.Eval(Container.DataItem, "REASON_FOR_ALTER_DISPO_2")%>' />

 

 

</td>

 

 

</tr>

 

 

</table>

 

 

</ItemTemplate>

 

 

<ItemStyle Font-Size="8pt" HorizontalAlign="Left" Width="50px" />

 

 

<HeaderStyle Font-Size="8pt" HorizontalAlign="Center" Font-Underline="false" Width="50px" />

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn UniqueName="alter_dispo_1" HeaderText="Alternate Disposition"

 

 

DataField="ALTER_DISPO_1" SortExpression="ALTER_DISPO_1" Visible="true" HeaderStyle-HorizontalAlign="Center"

 

 

ItemStyle-HorizontalAlign="Left">

 

 

<ItemTemplate>

 

 

<table border="0" style="border-style: none;">

 

 

<tr>

 

 

<td style="border-style: none; font-size: 8pt;" align="left">

 

 

<asp:Label runat="server" ID="lblAlternate_Disposition" align="left" Text='<%# ValidateString(DataBinder.Eval(Container.DataItem, "ALTER_DISPO_1") + "" + DataBinder.Eval(Container.DataItem, "ALTER_DISPO_2"))%>'></asp:Label>

 

 

</td>

 

 

<td style="border-style: none; text-align: right;" align="right">

 

 

<asp:ImageButton ID="ibtnAlternate_Disposition" runat="server" OnClientClick="javascript:fnExpandW(this,'alter_dispo_1')"

 

 

ImageUrl="~/IMAGES/btn_Dots.GIF" ImageAlign="Right" /><asp:HiddenField ID="hdnAlternate_Disposition"

 

 

runat="server" Value='<%# DataBinder.Eval(Container.DataItem, "ALTER_DISPO_1") + "" + DataBinder.Eval(Container.DataItem, "ALTER_DISPO_2")%>' />

 

 

</td>

 

 

</tr>

 

 

</table>

 

 

</ItemTemplate>

 

 

<ItemStyle Font-Size="8pt" HorizontalAlign="Left" Width="50px" />

 

 

<HeaderStyle Font-Size="8pt" HorizontalAlign="Center" Font-Underline="false" Width="50px" />

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn UniqueName="" HeaderText="Attachments" DataField="" SortExpression=""

 

 

Visible="true" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left">

 

 

<ItemTemplate>

 

 

<table border="0" style="border-style: none;">

 

 

<tr>

 

 

<td style="border-style: none; font-size: 8pt;" align="left">

 

 

<asp:Label runat="server" ID="lblAttachments" Text="Attachments" ForeColor="Black"></asp:Label><asp:HyperLink

 

 

runat="server" ID="hplAttachments" Text="Attachments" Style="cursor: hand;"></asp:HyperLink><asp:HiddenField

 

 

ID="hdnAttachmentCount" runat="server" Value='<%# DataBinder.Eval(Container.DataItem,"ATTACHMENTS_COUNT")%>' />

 

 

</td>

 

 

</tr>

 

 

</table>

 

 

</ItemTemplate>

 

 

<ItemStyle Font-Size="8pt" HorizontalAlign="Left" ForeColor="Blue" Width="50px" />

 

 

<HeaderStyle Font-Size="8pt" HorizontalAlign="Center" Font-Underline="false" Width="50px" />

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn UniqueName="Group_Name" HeaderText="Responsible Group"

 

 

DataField="GROUP_NAME" SortExpression="GROUP_NAME" Visible="true" HeaderStyle-HorizontalAlign="Center"

 

 

ItemStyle-HorizontalAlign="Left">

 

 

<ItemTemplate>

 

 

<table border="0" style="border-style: none;">

 

 

<tr>

 

 

<td style="border-style: none; font-size: 8pt;" align="left">

 

 

<asp:Label runat="server" ID="lblResponsible_Group" align="left" Text='<%# ValidateString(DataBinder.Eval(Container.DataItem, "GROUP_NAME"))%>'></asp:Label>

 

 

</td>

 

 

<td style="border-style: none; text-align: right;" align="right">

 

 

<asp:ImageButton ID="ibtnResponsible_Group" runat="server" OnClientClick="javascript:fnExpandW(this,'Group_Name')"

 

 

ImageUrl="~/IMAGES/btn_Dots.GIF" ImageAlign="Right" /><asp:HiddenField ID="hdnResponsible_Group"

 

 

runat="server" Value='<%# DataBinder.Eval(Container.DataItem, "GROUP_NAME")%>' />

 

 

</td>

 

 

</tr>

 

 

</table>

 

 

</ItemTemplate>

 

 

<ItemStyle Font-Size="8pt" HorizontalAlign="Left" Width="50px" />

 

 

<HeaderStyle Font-Size="8pt" HorizontalAlign="Center" Font-Underline="false" Width="50px" />

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn UniqueName="Created_By" HeaderText="Created By" DataField="CREATED_BY"

 

 

SortExpression="CREATED_BY" Visible="true" HeaderStyle-HorizontalAlign="Center"

 

 

ItemStyle-HorizontalAlign="Left">

 

 

<ItemTemplate>

 

 

<table border="0" style="border-style: none;">

 

 

<tr>

 

 

<td style="border-style: none; font-size: 8pt;" align="left">

 

 

<asp:Label runat="server" ID="lblCreated_By" align="left" Text='<%# ValidateString(DataBinder.Eval(Container.DataItem, "CREATED_BY"))%>'></asp:Label>

 

 

</td>

 

 

<td style="border-style: none; text-align: right;" align="right">

 

 

<asp:ImageButton ID="ibtnCreated_By" runat="server" OnClientClick="javascript:fnExpandW(this,'Created_By')"

 

 

ImageUrl="~/IMAGES/btn_Dots.GIF" ImageAlign="Right" /><asp:HiddenField ID="hdnCreated_By"

 

 

runat="server" Value='<%# DataBinder.Eval(Container.DataItem, "CREATED_BY")%>' />

 

 

</td>

 

 

</tr>

 

 

</table>

 

 

</ItemTemplate>

 

 

<ItemStyle Font-Size="8pt" HorizontalAlign="Left" Width="50px" />

 

 

<HeaderStyle Font-Size="8pt" HorizontalAlign="Center" Font-Underline="false" Width="50px" />

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridButtonColumn ButtonType="LinkButton" ItemStyle-Font-Size="8pt" Text="Remove"

 

 

UniqueName="Remove" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left"

 

 

CommandName="Delete">

 

 

<HeaderStyle HorizontalAlign="Center" Width="50px" />

 

 

<ItemStyle Font-Size="8pt" HorizontalAlign="Left" ForeColor="Blue" Width="50px" />

 

 

</telerik:GridButtonColumn>

 

 

</Columns>

 

 

<EditFormSettings EditFormType="Template">

 

 

<EditColumn FilterControlAltText="Filter EditCommandColumn1 column" UniqueName="EditCommandColumn1">

 

 

</EditColumn>

 

 

<FormTemplate>

 

 

<table border="0" cellpadding="0" cellspacing="0" width="95%" align="center" style="table-layout:fixed;">

 

 

<tr>

 

 

<td>

 

 

&nbsp;

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td class="subTitle" align="left">

 

Reason for Alternate Disposition

<span class="reqField">*</span>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td class="tblText" align="left">

 

 

<telerik:RadEditor ID="rdReasonAltDisp" runat="server" align="left" Content='<%# DataBinder.Eval(Container.DataItem, "REASON_FOR_ALTER_DISPO_1") + "" + DataBinder.Eval(Container.DataItem, "REASON_FOR_ALTER_DISPO_2")%>'

 

 

MaxTextLength="4000" CssClass="tblText" EnableContextMenus="false" EnableDocking="false"

 

 

Skin="WebBlue" EnableTab="false" Height="100px" ShowHtmlMode="false" ShowPreviewMode="false"

 

 

ShowSubmitCancelButtons="false" SpellCheckProvider="EditDistanceProvider" StripFormattingOnPaste="All"

 

 

ToolsFile="~/XML_STORAGE/BasicTools.xml" UseEmbeddedScripts="false" Width="840px">

 

 

</telerik:RadEditor>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td>

 

 

&nbsp;

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td class="subTitle" align="left">

 

AlternateDisposition

<span class="reqField">*</span>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td align="left">

 

 

<telerik:RadEditor ID="rdAltDisp" runat="server" align="left" Content='<%# DataBinder.Eval(Container.DataItem, "ALTER_DISPO_1") + "" + DataBinder.Eval(Container.DataItem, "ALTER_DISPO_2")%>'

 

 

MaxTextLength="4000" CssClass="tblText" EnableContextMenus="false" EnableDocking="false"

 

 

Skin="WebBlue" EnableTab="false" Height="100px" ShowHtmlMode="false" ShowPreviewMode="false"

 

 

ShowSubmitCancelButtons="false" SpellCheckProvider="EditDistanceProvider" StripFormattingOnPaste="All"

 

 

ToolsFile="~/XML_STORAGE/BasicTools.xml" UseEmbeddedScripts="false" Width="840px">

 

 

</telerik:RadEditor>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td>

 

 

<table width="100%" id="tblUpload" runat="server" border="0" cellpadding="2" cellspacing="0" style="padding-top:5px;"

 

 

align="left">

 

 

<tr>

 

 

<td width="15%" class="subTitle" style="height: 100px;" align="left">

 

Upload Attachment

 

</td>

 

 

<td width="15%" style="height: 100px; vertical-align:top;" align="left">

 

 

<div style="overflow-y: auto; overflow-x: hidden; height: 90px; vertical-align:top; padding-top:5px;">

 

 

<telerik:RadAsyncUpload ID="RadAsynUploadAttachment" runat="server" MultipleFileSelection="Automatic"

 

 

EnableEmbeddedScripts="true" EnableEmbeddedSkins="true" EnableEmbeddedBaseStylesheet="true" Skin="WebBlue"

 

 

TemporaryFolder="upload" AllowedFileExtensions=".jpg,.jpeg,.png,.tif">

 

 

</telerik:RadAsyncUpload>

 

 

<asp:HiddenField ID="hdnAttachmentCountEdit" runat="server" Value='<%# DataBinder.Eval(Container.DataItem,"ATTACHMENTS_COUNT")%>' />

 

 

</div>

 

 

</td>

 

 

<td class="subTitle" width="15%" align="center">

 

Alternate Disposition

<br />

 

Affected on Airplane(s)

<span class="reqField">*</span><br />

 

 

<br />

 

 

<span class="subtext">Ctrl Click to Multi Select</span>

 

 

</td>

 

 

<td class="tblText" style="height: 100px; vertical-align: bottom;" width="20%" align="left">

 

 

 

<asp:ListBox runat="server" ID="lbAffAirplaneList" Rows="5"

 

 

SelectionMode="Multiple" Visible="true"></asp:ListBox>

 

 

 

</td>

 

 

</tr>

 

 

</table>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td>

 

 

&nbsp;

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td class="tblText" align="left">

 

 

<asp:LinkButton ID="lnkUpdate" runat="server" CommandArgument='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'

 

 

CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'

 

 

Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'>

 

 

 

</asp:LinkButton>&#160;&#160;

 

 

<asp:LinkButton ID="lnkCancel" runat="server" CausesValidation="False" CommandName="Cancel"

 

 

Text="Cancel"></asp:LinkButton>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td>

 

 

&nbsp;

 

 

</td>

 

 

</tr>

 

 

</table>

 

 

</FormTemplate>

 

 

</EditFormSettings>

 

 

</MasterTableView><ValidationSettings CommandsToValidate="PerformInsert,Update" />

 

 

<ClientSettings AllowGroupExpandCollapse="false" ReorderColumnsOnClient="true" AllowColumnsReorder="false">

 

 

<Selecting AllowRowSelect="false" />

 

 

<ClientEvents OnGridCreated="GridCreated" />

 

 

<Resizing AllowColumnResize="false" AllowResizeToFit="true" />

 

 

<Scrolling AllowScroll="True" FrozenColumnsCount="0" ScrollHeight="180px" UseStaticHeaders="true"

 

 

SaveScrollPosition="true" />

 

 

</ClientSettings>

 

 

</telerik:RadGrid>

 

 

 

</td>

 

 

</tr>

 

 

</table>

 

Shinu
Top achievements
Rank 2
 answered on 23 Dec 2011
1 answer
88 views
Is there a server-side way to determine if a RadWindowManager (name instance or generic) exists on a page?
Princy
Top achievements
Rank 2
 answered on 23 Dec 2011
1 answer
64 views
I WANT TO KNOW IF CAN READ ALL ROWS IN THE SERVER SIDE

 ITEM[0].CELL.TEXT  ? 

PLEASE
THANKS
Shinu
Top achievements
Rank 2
 answered on 23 Dec 2011
6 answers
254 views
I have a RadGrid that is read-only. User clicks a "Create" button and it creates a new record to the grid with some default values already in place. I placed a ajaxManager and a ajaxPanel on the page. The manager points to the button as initiating the request and the grid as being updated by the request from the button. The button has "onClick=" to the server-side click event which adds a record for the grid. But this is not being hit first. Instead "NeedDataSource" of the grid then the "_Click" event (which has the rebind in it too), lastly the "PreRender" of the grid. Sadly the grid does not reflect the added record. It does pick up the last one when I click the "Create" again, due to the rebind grabbing the previous addition the the table.

How can I avoid this? Why is the "NeedDataSource" being hit first before the actual button whom requested the call?

Thanks
SDI
SDI
Top achievements
Rank 1
 answered on 23 Dec 2011
1 answer
74 views
I've implemented horizontal scrolling with static headers for my grid.  However I noticed that if I scroll to the right most, the columns move by about 20px and misalign with the header.  It goes back to normal once I move the scrollbar from the right most position.  I don't know the telerik version im using, but I do know its not the latest.  Is this an issue with previous version?

Thanks,

Jun
Pavlina
Telerik team
 answered on 22 Dec 2011
1 answer
120 views
For the life of me I cant figure out how to get the bars to sit next to each other. Am I missing something? I've attached a screen shot, each date should have a bar of data. Thanks!


<telerik:RadChart ID="chart_EmployeeStats" SkinsOverrideStyles="false" Skin="Telerik" runat="server" Height="360" width="1200" EnableViewState="false" 
        <ChartTitle TextBlock-Text = "Total Letters For The Day" TextBlock-Appearance-TextProperties-Color="Black" TextBlock-Visible="false"></ChartTitle> 
          
      <PlotArea>
            <Appearance Dimensions-Margins="18%, 24%, 35%, 10%">
            </Appearance>
            <XAxis LayoutMode="Inside" AutoScale="false" >
                <Appearance ValueFormat="ShortDate" MajorGridLines-Visible="false"  >
                    <LabelAppearance RotationAngle="90" Position-AlignedPosition="Top">
                    </LabelAppearance>
                </Appearance>
            </XAxis>
            <YAxis IsZeroBased="false">
            </YAxis>
        </PlotArea>  
  </telerik:RadChart>
Richard
Top achievements
Rank 1
 answered on 22 Dec 2011
4 answers
255 views
Hi,

Through Telerik's examples I know how to
-Cause Row Editing through a double or single  click on a row
-how to enable the highlighting of a row from the client side settings
-how to do client site row selection.  
by 
<ClientSettings EnableRowHoverStyle="true" >   
   <Selecting AllowRowSelect="True" />   
</ClientSettings> 
 

I'll I am interesting in having is the EnableRowHoverStyle="true" and if they click on a row it does a postback to the 

 

 

 

ItemCommand event for the grid?  Is this possible?  If so how is it done?  Last, where can I set the CommandName for this to happen?  I am not looking for a client event here.  I'm looking for a full postback.  I will handle the setting for the row being selected and all that in the code behind myself.

 

 

 

 

 

 

 

Thank you

TonyG
Top achievements
Rank 1
 answered on 22 Dec 2011
1 answer
124 views
I am new to Rad Ajax Comntrols and i was looking to put a chart in my program that would show the percentage of entries each sales person has.  My data is in an Access database and I think I need to bind the chart to it in some way.  Anyways I looked at the demo app that gets put on the desktop "http://localhost:8301/radcontrols_aspnetajax/chart/examples/databinding/objects/defaultcs.aspx" when I select data binding->Database I get a stack error.  What was missed on install? 

Cannot open user default database. Login failed.
Login failed for user 'Stephan-PC\Stephan'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Cannot open user default database. Login failed.
Login failed for user 'Stephan-PC\Stephan'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SqlException (0x80131904): Cannot open user default database. Login failed. Login failed for user 'Stephan-PC\Stephan'.] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +5064474 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +234 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2275 System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +35 System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, SqlConnection owningObject) +183 System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, TimeoutTimer timeout) +239 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, TimeoutTimer timeout, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +195 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +232 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +185 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +33 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +524 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66 System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +479 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +108 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +126 System.Data.SqlClient.SqlConnection.Open() +125 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +123 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +319 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +92 System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1618 System.Web.UI.WebControls.ListControl.OnDataBinding(EventArgs e) +97 System.Web.UI.WebControls.ListControl.PerformSelect() +34 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +74 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +66 System.Web.UI.WebControls.ListControl.OnPreRender(EventArgs e) +29 System.Web.UI.Control.PreRenderRecursiveInternal() +103 System.Web.UI.Control.PreRenderRecursiveInternal() +175 System.Web.UI.Control.PreRenderRecursiveInternal() +175 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2496 

Richard
Top achievements
Rank 1
 answered on 22 Dec 2011
3 answers
113 views
Hi,

I am trying to create a batch server update for a Telerik Grid from code behind but I am unable to retrieve the latest changes in the textbox. Within the grid I set each textbox as follows and from the code behind I am forcing to enter edit Mode from the Prerender event:

<telerik:GridBoundColumn UniqueName="ContactPerson" HeaderText="Contact Person" DataField="ContactPerson" />


Also in code behind, when the user has finished committing changes on each textbox, the following event is fired when pressing a button:

Private Sub btnShipOut_Click(sender As Object, e As System.EventArgs) Handles btnShipOut.Click

 

 

For Each item As GridItem In RadGrid2.MasterTableView.Items

 

If TypeOf item Is GridEditableItem Then

 

Dim editableItem As GridDataItem = DirectCast(item, GridDataItem)

 

Dim ContactPerson As String = editableItem.Cells(2).Text

End If

 

 

Next

 

End Sub

The code works well but I am receiving the default value on each textbox instead of the updated value entered by the user before the postback. Instead, the new values are displayed in the grid after the postback.
I also tried the following code to retrieve the values but I get an OutOfRangeException error...

Dim txtbx
As TextBox = CType(editableItem("ContactPerson").Controls(0), TextBox)
Dim txtbxvalue as string = txtbx.value

 


Any help please?

Best regards.

 

 

 

 

Teck
Top achievements
Rank 1
 answered on 22 Dec 2011
3 answers
116 views
Hello all,
I'm use the RadGrid in WebServerControl and I'm have a problem with the event of "SelectedIndexChanged" with "AllowFilteringByColumn = true;"
This is the declaration code for my RadGrid : 
var Grid = 
new RadGrid
            {
                AllowFilteringByColumn = true,
                AllowPaging = true,
                AllowSorting = true,
                ShowStatusBar = true,
                ShowHeader = true,
                GridLines = GridLines.None,
                PageSize = PageSize,
                EnableViewState = true,
                ID = string.Format("{0}_Grid", ID)
            };

When I'm selected a row after use filters, the grid is rebind and my filter is loosed.
The value of "SelectedValue" doesn't match with my selection and the grid is reinitialised.

My Code:
WebServerControl:
public class CustomRadGrid : WebControl, INamingContainer
{
    protected RadAjaxManager AjaxManager;
    protected RadAjaxLoadingPanel AjaxLoadingPanel;
    protected RadGrid Grid;
    protected ObjectDataSource ObjDataSource;
 
    #region PROPERTIES
    public string SelectCountMethod;
    public string SelectMethod;
    public string MaximumRowsParameterName;
    public string StartRowIndexParameterName;
    public string DataObjectTypeName;
    public List<KeyValuePair<string, string>> SelectParameters;
 
    /// <summary>
    /// Display columns in gridview
    /// </summary>
    /// <value>
    /// Key = ColumnName       
    /// Value = DiplayName, Type of the column ToString()
    /// </value>
    public List<KeyValuePair<string, KeyValuePair<string, Type>>> DisplayColumns;
 
    /// <summary>
    /// Data Key Names uses in Master Table View
    /// </summary>
    public string[] DataKeyNames;
 
    /// <summary>
    /// If you want use external DataSource, set this DataSourceID
    /// </summary>
    public string DataSourceID;
 
    /// <summary>
    /// Set this for initialize a control to refresh after row selection
    /// </summary>
    public string ControlIDToRefresh { private get; set; }
 
    /// <summary>
    /// Gets or sets the size of the page.
    /// </summary>
    /// <value>
    /// The size of the page.
    /// </value>
    private int _pageSize;
    public int PageSize
    {
        get
        {
            return (Grid != null) ? Grid.PageSize : _pageSize;
        }
        set
        {
            _pageSize = value;
            if (Grid != null)
            { Grid.PageSize = _pageSize; }
        }
    }
 
    /// <summary>
    /// Gets the index of the current page.
    /// </summary>
    /// <value>
    /// The index of the current page.
    /// </value>
    public int CurrentPageIndex
    {
        get
        {
            EnsureChildControls();
            return (Grid != null) ? Grid.CurrentPageIndex : 0;
        }
    }
 
    /// <summary>
    /// Gets the selected value.
    /// </summary>
    private string _selectedValue;
    public string SelectedValue
    {
        get
        {
            return string.IsNullOrEmpty(_selectedValue) ? "" : _selectedValue;
        }
    }
 
    /// <summary>
    /// Save grid settings
    /// </summary>
    private string _settings;
 
    #endregion PROPERTIES
 
    /// <summary>
    /// Initializes a new instance of the <see cref="CustomRadGrid"/> class.
    /// </summary>
    public CustomRadGrid()
    {
        PageSize = 20;
        DataSourceID = "";
    }
 
    /// <summary>
    /// Gets a <see cref="T:System.Web.UI.ControlCollection"/> object that represents the child controls for a specified server control in the UI hierarchy.
    /// </summary>
    /// <returns>
    /// The collection of child controls for the specified server control.
    ///   </returns>
    public override ControlCollection Controls
    {
        get
        {
            EnsureChildControls();
            return base.Controls;
        }
    }
 
    /// <summary>
    /// Raises the <see cref="E:System.Web.UI.Control.Load"/> event.
    /// </summary>
    /// <param name="e">The <see cref="T:System.EventArgs"/> object that contains the event data.</param>
    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);
 
        #region DataSource
        if (string.IsNullOrEmpty(DataSourceID))
        {
            ObjDataSource = new ObjectDataSource
            {
                //EnablePaging = true,
                TypeName = "BLL.BL",
                ID = string.Format("{0}_ObjDataSource", ID),
                SelectMethod = SelectMethod,
                SelectCountMethod = SelectCountMethod
            };
            if (!string.IsNullOrEmpty(MaximumRowsParameterName))
                ObjDataSource.MaximumRowsParameterName = MaximumRowsParameterName;
            if (!string.IsNullOrEmpty(StartRowIndexParameterName))
                ObjDataSource.StartRowIndexParameterName = StartRowIndexParameterName;
            ObjDataSource.Selecting += ObjDataSourceSelecting;
            foreach (var selectParameter in SelectParameters)
            {
                ObjDataSource.SelectParameters.Add(selectParameter.Key, selectParameter.Value);
            }
            Controls.Add(ObjDataSource);
        }
        #endregion DataSource
 
        #region GRID
        Grid = new RadGrid
        {
            AllowFilteringByColumn = true,
            AllowPaging = true,
            AllowSorting = true,
            ShowStatusBar = true,
            ShowHeader = true,
            GridLines = GridLines.None,
            PageSize = PageSize,
            EnableViewState = true,
            ID = string.Format("{0}_Grid", ID)
        };
        if (DisplayColumns == null || DisplayColumns.Count == 0)
        {
            Grid.MasterTableView.AutoGenerateColumns = Grid.AutoGenerateColumns = true;
        }
        else
        {
            Grid.MasterTableView.AutoGenerateColumns = Grid.AutoGenerateColumns = false;
            foreach (var displayColumn in DisplayColumns)
            {
                Grid.MasterTableView.Columns.Add(new GridBoundColumn
                {
                    UniqueName = displayColumn.Key,
                    DataField = displayColumn.Key,
                    DataType = displayColumn.Value.Value,
                    HeaderText = displayColumn.Value.Key,
                    DataFormatString =
                        displayColumn.Value.Value == typeof(DateTime)
                            ? "{0:d}"
                            : "{0}"
                });
            }
        }
 
        Grid.ClientSettings.EnableRowHoverStyle = true;
        Grid.ClientSettings.EnableAlternatingItems = true;
        Grid.ClientSettings.EnablePostBackOnRowClick = true;
        Grid.ClientSettings.Selecting.AllowRowSelect = true;
 
        Grid.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.Top;
        Grid.MasterTableView.CommandItemSettings.ShowRefreshButton = false;
        Grid.MasterTableView.CommandItemSettings.ShowAddNewRecordButton = false;
        Grid.MasterTableView.CommandItemSettings.ShowExportToExcelButton = true;
        Grid.MasterTableView.PagerStyle.AlwaysVisible = true;
 
        //Select the DataSource
        if (string.IsNullOrEmpty(DataSourceID) && ObjDataSource != null)
        { Grid.DataSourceID = ObjDataSource.ID; }
        else if (ObjDataSource == null && !string.IsNullOrEmpty(DataSourceID))
        { Grid.DataSourceID = DataSourceID; }
        else
        { Grid.NeedDataSource += OnNeedDataSource; }
        //Initialise DataKeys
        if (DataKeyNames != null && DataKeyNames.Count() > 0)
        { Grid.MasterTableView.DataKeyNames = DataKeyNames; }
 
        //Grid events
        //Grid.Init += GridInit;
        Grid.ItemCommand += GridItemCommand;
        Grid.ItemCreated += GridItemCreated;
        Grid.SelectedIndexChanged += GridSelectedIndexChanged;
        Controls.Add(Grid);
 
        #endregion GRID
 
        #region AJAX
        //Initialise Ajax Manager
        AjaxLoadingPanel = new RadAjaxLoadingPanel
        {
            InitialDelayTime = 1,
            MinDisplayTime = 200,
            ID = string.Format("{0}_AjaxLoadingPanel", ID)
        };
        Controls.Add(AjaxLoadingPanel);
 
        AjaxManager = RadAjaxManager.GetCurrent(Page);
        if (AjaxManager == null)
        {
            AjaxManager = new RadAjaxManager
            {
                ID = string.Format("{0}_AjaxManager", ID),
                DefaultLoadingPanelID = AjaxLoadingPanel.ID,
                EnableAJAX = true
            };
            Controls.Add(AjaxManager);
            Page.Items.Add(typeof(RadAjaxManager), AjaxManager);
        }
 
        //Set Ajax Settings:
        if (!string.IsNullOrEmpty(ControlIDToRefresh))
        {
            var ajaxSetting = new AjaxSetting(Grid.ID);
            ajaxSetting.UpdatedControls.Add(new AjaxUpdatedControl(ControlIDToRefresh, AjaxLoadingPanel.ID));
            ajaxSetting.EventName = "OnRowSelected";
            AjaxManager.AjaxSettings.Add(ajaxSetting);
        }
        AjaxManager.AjaxSettings.AddAjaxSetting(Grid, Grid, AjaxLoadingPanel, UpdatePanelRenderMode.Inline);
 
        //To export in Excel:
        if (!Page.ClientScript.IsStartupScriptRegistered(GetType(), string.Format("{0}_onRequestStart", ID)))
        {
            var onRequestStart = string.Format("function {0}_onRequestStart(ajaxManager, eventArgs){{if(eventArgs.EventTarget.indexOf('ExportToExcelButton') != -1){{eventArgs.EnableAjax = false;}}}}", ID);
            Page.ClientScript.RegisterStartupScript(GetType(), string.Format("{0}_onRequestStart", ID), onRequestStart, true);
            AjaxManager.ClientEvents.OnRequestStart = string.Format("{0}_onRequestStart", ID);
        }
        #endregion AJAX
    }
 
    /// <summary>
    /// Grids the init.
    /// Reduce the set of filter functions so that the filter menu can only show the NoFilter, Contains, EqualTo, GreaterThan and LessThan items
    /// </summary>
    /// <param name="sender">The sender.</param>
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
    void GridInit(object sender, EventArgs e)
    {
        var menu = Grid.FilterMenu;
        var i = 0;
        while (i < menu.Items.Count)
        {
            if (menu.Items[i].Text == "NoFilter" || menu.Items[i].Text == "Contains" || menu.Items[i].Text == "EqualTo" || menu.Items[i].Text == "GreaterThan" || menu.Items[i].Text == "LessThan")
            {
                i++;
            }
            else
            {
                menu.Items.RemoveAt(i);
            }
        }
    }
 
    #region GRID EVENTS
    /// <summary>
    /// Delegate to attach method on SelectedIndexChanged
    /// </summary>
    /// <param name="sender">The sender.</param>
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
    public delegate void SelectedIndexChangedHandler(object sender, EventArgs e);
 
    /// <summary>
    /// Occurs when [selected index changed].
    /// </summary>
    [Category("Configuration"), Browsable(true), Description("Evènement associé au gridview")]
    public event SelectedIndexChangedHandler SelectedIndexChanged;
 
    /// <summary>
    /// Grids the selected index changed.
    /// </summary>
    /// <param name="sender">The sender.</param>
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
    void GridSelectedIndexChanged(object sender, EventArgs e)
    {
        _selectedValue = (string)(Grid.SelectedValue ?? "");
        if (SelectedIndexChanged != null)
            SelectedIndexChanged(this, e);
    }
 
    /// <summary>
    /// Delegate to attach method on NeedDataSource
    /// </summary>
    /// <param name="sender">The sender.</param>
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
    public delegate void NeedDataSourceHandler(object sender, EventArgs e);
 
    /// <summary>
    /// Occurs when [need data source].
    /// </summary>
    [Category("Configuration"), Browsable(true), Description("Evènement associé au gridview")]
    public event NeedDataSourceHandler NeedDataSource;
 
    /// <summary>
    /// Called when [need data source].
    /// </summary>
    /// <param name="sender">The sender.</param>
    /// <param name="e">The <see cref="Telerik.Web.UI.GridNeedDataSourceEventArgs"/> instance containing the event data.</param>
    void OnNeedDataSource(object sender, GridNeedDataSourceEventArgs e)
    {
        if (NeedDataSource != null) { NeedDataSource(this, e); }
        else if (string.IsNullOrEmpty(DataSourceID)) { Grid.DataSource = ObjDataSource; }
    }
    #endregion GRID EVENTS
 
    #region EXPORT
    /// <summary>
    /// To know if exporting
    /// </summary>
    bool _isExport = false;
 
    /// <summary>
    /// Grids the item created.
    /// </summary>
    /// <param name="sender">The sender.</param>
    /// <param name="e">The <see cref="Telerik.Web.UI.GridItemEventArgs"/> instance containing the event data.</param>
    void GridItemCreated(object sender, GridItemEventArgs e)
    {
        //Remove the filter line when exporting data
        if (e.Item is GridFilteringItem && _isExport)
            e.Item.Visible = false;
    }
 
    /// <summary>
    /// Grids the item command.
    /// </summary>
    /// <param name="sender">The sender.</param>
    /// <param name="e">The <see cref="Telerik.Web.UI.GridCommandEventArgs"/> instance containing the event data.</param>
    private void GridItemCommand(object sender, GridCommandEventArgs e)
    {
        if (e.CommandName == RadGrid.ExportToExcelCommandName ||
             e.CommandName == RadGrid.ExportToWordCommandName ||
             e.CommandName == RadGrid.ExportToCsvCommandName)
        {
            Grid.ExportSettings.OpenInNewWindow = true;
            Grid.ExportSettings.ExportOnlyData = true;
            Grid.ExportSettings.IgnorePaging = true;
            Grid.ExportSettings.Excel.Format = GridExcelExportFormat.Html;
            Grid.ExportSettings.FileName = string.Format("[{0}]Export", DateTime.Now.ToString("yyyyMMdd_HHmm"));
            _isExport = true;
        }          
    }
    #endregion EXPORT
 
    #region DATASOURCE
    /// <value>
    /// The data source.
    /// </value>
    public object DataSource
    {
        set
        {
            EnsureChildControls();
            Grid.DataSource = value;
        }
    }
 
    /// <summary>
    /// Objs the data source selecting.
    /// </summary>
    /// <param name="sender">The sender.</param>
    /// <param name="e">The <see cref="System.Web.UI.WebControls.ObjectDataSourceSelectingEventArgs"/> instance containing the event data.</param>
    private void ObjDataSourceSelecting(object sender, ObjectDataSourceSelectingEventArgs e)
    {
        if (SelectParameters != null)
        {
            ObjDataSource.SelectParameters.Clear();
            if (!e.ExecutingSelectCount &&
                SelectParameters.Count != 0)
            {
                foreach (var selectParameter in SelectParameters)
                {
                    ObjDataSource.SelectParameters.Add(selectParameter.Key, selectParameter.Value);
                }
            }
        }
 
    }
    #endregion DATASOURCE
}

WebPart who's use it :

public class DIList : Abstract.BaseAjaxWebpart
    {
        protected GridViewDI DIs;
        protected EditDI DIEdit;
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
 
            DIEdit = new EditDI { ID = string.Format("{0}_DIEdit", this.ID) };
            Controls.Add(DIEdit);
 
            DIs = new GridViewDI { ID = string.Format("{0}_DIList", this.ID), ControlIDToRefresh = DIEdit.ID };
            Controls.AddAt(0, DIs);
            DIs.SelectedIndexChanged += DIListSelectedIndexChanged;
        }
 
        void DIListSelectedIndexChanged(object sender, EventArgs e)
        {
            DIEdit.idDIValue = DIs.SelectedValue;
        }
    }

Andrey
Telerik team
 answered on 22 Dec 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?