Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1336
Blank Group Description
posted

Hi all,

When you group by a column that contains rows without a value (or an empty string), you get a grouping row that has a description that also has no value.  Well, it does say "(x items)", but there's nothing before the item count.

We'd like to see the string "[Unspecified] (13 items)" for example.

I've done a fairly crude implementation like so:

 

Private Sub WorkPlanGrid_InitializeRecord(ByVal sender As Object, ByVal e As InitializeRecordEventArgs) Handles WorkPlanGrid.InitializeRecord

 

 

    If TypeOf e.Record Is GroupByRecord Then

 

         Dim rec As GroupByRecord = DirectCast(e.Record, GroupByRecord)

 

 

         If rec.Description.Trim.StartsWith("(") Then

                  rec.Description =

"[Unspecified] " & rec.Description

 

        End If

 

    End if

 

End Sub

I could make it more robust, as if there is a value that genuinely starts with an open bracket, it would not work.  However, it would be good if there was a simple string property on the XamDataGrid itself, that you could set, in order for the grid to do this for you!

What do you think?

Dave

 

(p.s. Any plans to improve the formatting in this forum?  my posts always look ok when composing, but mess up when posted... it's almost impossible to paste code and get it to look good!)

Parents
  • 69686
    posted

    Hello Dave,

    To the best of my knowledge there is no such property that you can set, but you do not need that.

    All predefined strings in our controls are Resource Strings and you can fully customize them - so is this string - it would display [null] (2 items) if you have 2 null values. You can modify by changing the resource string for this. Please follow this article in our help to see all the information about Resource Strings and how to change them. Of course the strings that you are interested in are the DataPresenter ones.

    Regarding formatting, actually the forum supports quite good formatting, however you have to use magic to get it working. For example, you can see this post by Joe Modica, where you can see that the code is pretty nicely formatted. I do not know how to make it this pretty as well. So I suppose I should go and ask them, shouldn't I?

Reply Children