Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
155 views

Hi,
    I am using RadGrid control for grouping but i dont want the sorting to be done.I want to display as it is in collection i am getting the data but unfortunately it is getting sorted on "PacName". I dont know where to change the code as i am psating the code here. So please can you suggest me how to remove sorting for this code as i want only grouping with the "PacName" not the sorting with the "PacName".Just i want to display the data as it is in collection which i am binding to grid.Waiting for your reply

ASPX  Page:
-------------------------------------------------------------------------------------------------------<radg:radgrid id="gridManagerItems" runat="server" CellSpacing="0" GroupingEnabled="True" ShowGroupPanel="False" CellPadding="3" AutoGenerateColumns="False" ToolTip="Reconciliation Statement List" Skin="None">

<MasterTableView AllowCustomPaging="False" AllowSorting="True" GroupsDefaultExpanded="False" AllowMultiColumnSorting="True" AllowPaging="False" GridLines="Both">

<HeaderStyle CssClass="Table_Header_Row_Blue"></HeaderStyle>

<GroupHeaderItemStyle CssClass="PACGroupRow ReceiptsGroupHeader"></GroupHeaderItemStyle>

<Columns>

<radg:GridTemplateColumn UniqueName="TemplateColumn" HeaderText="">

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

<HeaderStyle HorizontalAlign="Left" Wrap="false" Width="1%"></HeaderStyle>

<ItemTemplate>

<asp:ImageButton id="imgEditbtn" CommandName="EditStatementItem" ToolTip="Edit" AlternateText="Edit"

Runat="server" ImageUrl="/_WebControlsResources/Images/edit.gif"></asp:ImageButton>

</ItemTemplate>

</radg:GridTemplateColumn>

<radg:GridTemplateColumn UniqueName="TemplateColumn">

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

<ItemTemplate>

<asp:ImageButton id="imgDeletebtn" CommandName="DeleteStatementItem" ToolTip="Delete" AlternateText="Delete"

Runat="server" ImageUrl="/_WebControlsResources/Images/delete.gif"></asp:ImageButton>

</ItemTemplate>

<HeaderStyle HorizontalAlign="Left" Wrap="false" Width="1%"></HeaderStyle>

</radg:GridTemplateColumn>

<radg:GridBoundColumn UniqueName="startDate" DataFormatString="{0:MM/dd/yyyy}" HeaderText="Begin Date" DataField="startDate">

<HeaderStyle HorizontalAlign="Left" Wrap="false" Width="70px"></HeaderStyle>

<ItemStyle HorizontalAlign="Left" Wrap="false"></ItemStyle>

</radg:GridBoundColumn>

<radg:GridBoundColumn UniqueName="endDate" DataFormatString="{0:MM/dd/yyyy}" HeaderText="End Date" DataField="endDate">

<HeaderStyle HorizontalAlign="Left" Wrap="false" Width="70px"></HeaderStyle>

<ItemStyle HorizontalAlign="Left" Wrap="false"></ItemStyle>

</radg:GridBoundColumn>

<radg:GridBoundColumn UniqueName="startingBalance" DataFormatString="{0:$#,###.00}" HeaderText="Starting Balance"

DataField="StartingBalance">

<HeaderStyle HorizontalAlign="Left" Wrap="false" Width="100px"></HeaderStyle>

<ItemStyle HorizontalAlign="Right" Wrap="false"></ItemStyle>

</radg:GridBoundColumn>

<radg:GridBoundColumn UniqueName="EndingBalance" DataFormatString="{0:$#,###.00}" HeaderText="Ending Balance"

DataField="EndingBalance">

<HeaderStyle HorizontalAlign="Left" Wrap="false" Width="100px"></HeaderStyle>

<ItemStyle HorizontalAlign="Right" Wrap="false"></ItemStyle>

</radg:GridBoundColumn>

<radg:GridBoundColumn UniqueName="Status" HeaderText="Status" DataField="Status">

<HeaderStyle HorizontalAlign="Left" Wrap="false" Width="1%"></HeaderStyle>

<ItemStyle HorizontalAlign="Left"></ItemStyle>

</radg:GridBoundColumn>

<radg:GridBoundColumn UniqueName="ReconciliationStatementID" HeaderText="ReconciliationStatementID" Visible="False" DataField="ReconciliationStatementID"></radg:GridBoundColumn>

<radg:GridBoundColumn UniqueName="BankAccountID" HeaderText="Bank AccountID" Visible="False" DataField="BankAccountID"></radg:GridBoundColumn>

<radg:GridBoundColumn UniqueName="BankAccountName" HeaderText="Bank Account Name" Visible="False" DataField="BankAccountName"></radg:GridBoundColumn>

</Columns>

<EditFormSettings>

<EditColumn UniqueName="EditCommandColumn"></EditColumn>

</EditFormSettings>

<ExpandCollapseColumn ButtonType="ImageButton" UniqueName="ExpandColumn" Visible="False">

<HeaderStyle Wrap="False" HorizontalAlign="Left" Width="19px" VerticalAlign="Middle" BackColor="#D3D3F1"></HeaderStyle>

</ExpandCollapseColumn>

</MasterTableView>

<GroupPanel Visible="False"></GroupPanel>

<ClientSettings AllowGroupExpandCollapse="True" ReorderColumnsOnClient="False" AllowDragToGroup="False" AllowColumnsReorder="False">

</ClientSettings>
</radg:radgrid>

ASPX.CS File :
----------------------------------------------------------------------------

This is how i am grouping : -

private

void GroupAndSortFields()

{

gridManagerItems.MasterTableView.AllowSorting =

false;

gridManagerItems.AllowSorting =

false;

gridManagerItems.MasterTableView.SortExpressions.AllowMultiColumnSorting =

true;

//************** Group By Logic *******************

GridGroupByExpression expression = new GridGroupByExpression();

GridGroupByField gridGroupByField = new GridGroupByField();

//Add select fields (beforne the "Group By" clause)

//ADD PAC Name grouping

expression =

new GridGroupByExpression();

gridGroupByField =

new GridGroupByField();

gridGroupByField.FieldName =

"PACName";

gridGroupByField.HeaderText =

"";

gridGroupByField.HeaderValueSeparator =

"";

expression.SelectFields.Add( gridGroupByField );

expression.GroupByFields.Add( gridGroupByField );

gridGroupByField.SortOrder =

GridSortOrder.None;

gridManagerItems.MasterTableView.GroupByExpressions.Add( expression );

//ADD Bank Account grouping

expression =

new GridGroupByExpression();

gridGroupByField =

new GridGroupByField();

gridGroupByField.FieldName =

"BankAccountID";

gridGroupByField.HeaderText =

"";

gridGroupByField.HeaderValueSeparator =

"";

gridGroupByField.SortOrder =

GridSortOrder.None;

expression.GroupByFields.Add( gridGroupByField );

gridGroupByField =

new GridGroupByField();

gridGroupByField.FieldName =

"BankAccountName";

gridGroupByField.HeaderText =

"";

gridGroupByField.HeaderValueSeparator =

"";

gridGroupByField.SortOrder =

GridSortOrder.None;

expression.SelectFields.Add( gridGroupByField );

gridManagerItems.MasterTableView.GroupByExpressions.Add( expression );

//ADD Year grouping

expression =

new GridGroupByExpression();

gridGroupByField =

new GridGroupByField();

gridGroupByField.FieldName =

"Year";

gridGroupByField.HeaderText =

"Year";

gridGroupByField.HeaderValueSeparator =

": ";

gridGroupByField.SortOrder =

GridSortOrder.None;

expression.SelectFields.Add( gridGroupByField );

expression.GroupByFields.Add( gridGroupByField );

gridManagerItems.MasterTableView.GroupByExpressions.Add( expression );

}

The above method I am calling in Page_Load()

Regards,
Srikanth.

Shinu
Top achievements
Rank 2
 answered on 23 May 2008
11 answers
264 views
Hi

I am trying to use the javascript function as given in "Changing grid ScrollHeight at runtime to fill its container height"

I am getting an error that "GridDatDiv" is null or not an object".

Can you help?

The script is given below.

function

GridCreated(sender, args)

{

var scrollArea = sender.GridDataDiv;

var parent = $get("gridContainer");

var gridHeader = sender.GridHeaderDiv;

scrollArea.style.height = parent.clientHeight - gridHeader.clientHeight +

"px";

}

Prabhu
Top achievements
Rank 1
 answered on 23 May 2008
10 answers
323 views
Every so often, and I don't know under what scenarios I can recreate this behaviour, the "loading..." text I have appearing under a node when it's clicked (data is loaded-on-demand) gets "stuck".

By this I mean that the text appears and the node doesn't expand. If I click a different node and then back to the original one, it loads the data all over again, but this time expands correctly (however the "loading..." text remains).

Is this a bug and if so is there a workaround?

Thanks all,
Daron

Markus
Top achievements
Rank 2
 answered on 23 May 2008
1 answer
146 views
I have three tables similar to these ones:

DISTRIBUTION:
id
le_id
amount

LE:
id
nlro_id

NLRO:
id
le

DISTRIBUTION.le_id  has foreign key relationship to LE.id
LE.nlro_id has foreign key relationship to NLRO.id

What I want to do with this is have a Grid display the NLRO.le and the DISTRIBUTION.amount. That's really all I need to display.

So I guess a statement such as this one would do the job:

SELECT NLRO.le, DISTRIBUTION.amount
FROM DISTRIBUTION
INNER JOIN LE
ON DISTRIBUTION.le_id = LE.id
INNER JOIN NLRO
ON LE.nlro_id = NLRO.id

This Grid should have some Edit button. If I use the built-in edit mode, it would show me "le" and "amount" as editable text fields.

But I want "le" to be a drop-down-list showing all "NLRO.le" items (their key is LE.id):
SELECT LE.id, NLRO.le
FROM LE
INNER JOIN NLRO
WHERE LE.nlro_id = NLRO.id

How do I do that? I found no way to define the way the edit pane looks like. And even if I can define that: how do I make sure that clicking the "save/update"-buttons will save the right stuff in DISTRIBUTION? (like the le_id instead of the nlro.le which is the text of the drop-down list?)

Thanks

s.
Shinu
Top achievements
Rank 2
 answered on 23 May 2008
1 answer
110 views
Hi,

Recent I added RAD Calender to my RAD GRID. Everything is working fine as required except there is a strange left and right border shade.

I tried to check it however I was not able to remove it. Here is the code that I have written inside the grid
 
<radG:GridTemplateColumn HeaderStyle-HorizontalAlign="Left" UniqueName="OfferExpiryDate1" 
 HeaderText="Offer Expiry Date1" ItemStyle-VerticalAlign="Middle"> 
 <ItemTemplate> 
   <radCln:RadDatePicker ID="RadDatePicker3" runat="server"> 
   </radCln:RadDatePicker> 
 </ItemTemplate> 
</radG:GridTemplateColumn> 

What could be the issue here?
Thanks in advance.
Dimo
Telerik team
 answered on 23 May 2008
1 answer
179 views
hi friends

i want to open Context Menu on row click of grid so i wright the code in server side but i did not gated the property or method of open context menu  by server side code. i am sending code with this mail so please help me to open Context menu.


Code:-

 Protected Sub uxrgridDetails_ItemCommand(ByVal source As Object, ByVal e As Telerik.WebControls.GridCommandEventArgs) Handles uxrgridDetails.ItemCommand
        Try
            Dim commandItem As Telerik.WebControls.GridDataItem = CType(e.Item, Telerik.WebControls.GridDataItem)
            Dim PhoneNo As String = CType(commandItem.FindControl("uxlbtnPhone1"), LinkButton).Text
            Dim PhoneNo1 As String = CType(commandItem.FindControl("uxlbtnPhone2"), LinkButton).Text
            Dim PhoneNo2 As String = CType(commandItem.FindControl("uxlbtnPhone3"), LinkButton).Text
            uxrcMenu.Items(0).Text = PhoneNo
            uxrcMenu.Items(1).Text = PhoneNo1
            uxrcMenu.Items(2).Text = PhoneNo2
            Dim NewItem As New Telerik.WebControls.RadMenu
            '''HERE I WANT TO OPEN CONTEXT MENU



        Catch ex As Exception

        End Try
    End Sub

Erjan Gavalji
Telerik team
 answered on 23 May 2008
1 answer
173 views
This is complex but i will do my best to explain as i really need the help. I am implementing an horizontal bar chart. Now my xaxis item count is four. I have the y values for all xaxis items to build my stack. Now for each stack/series, I want to assign my own custom color. So basically all stack will have different colors. Is this possible and if yes How do I accoumplish it cos its seems the system is still assignng colors to my series eventhough i specify a color. thanks.

In short. what am really asking is how do i specify different my own color for an item in a series for a stacked bar chart.
Ves
Telerik team
 answered on 23 May 2008
3 answers
321 views
Hi,

I have a RadGrid whose Columns may vary based on the criteria. Based on the column displayed the width is being set by getting the values from the Xml.
The columns width are setting fine when the grid is in display Mode.
On Edit mode what ever i set the width of the column it is set the TextBoxEditor width that is displayed in the columns.

I DONT want to change the textbox width, but want to reduce the column width at runtime.
Is there some property that needs to be set to override on the textbox.

I can achieve this if i manually resize the column width.
Help me out how this can be achieved

Thanks
Daniel
Princy
Top achievements
Rank 2
 answered on 23 May 2008
3 answers
134 views
I`m new to rad controls and web devlopment in general - i`m a desktop-app developer, i want to know how to use rad grid as an input control for new rows?
I had add edit and delete columns already.

Regards.
Princy
Top achievements
Rank 2
 answered on 23 May 2008
1 answer
172 views
I am using the radajaxpanel pretty heavily and every so often I get an error message that is an object reference error. My issue is that if it's caught through the ajax it shows an alert message, but nothing is ever logged. How can I get this error messages logged to the event viewer so I can fix them. The object reference error is hard enough to diagnose when I have debugging information and in this case I have nothing.
Steve
Telerik team
 answered on 23 May 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?