Skip to content

Replies

0
Michael Mangelschots
Michael Mangelschots answered on Oct 1, 2020 12:27 PM

Andrew,

The button is only added in the first row. By the way I'm using Blazor server side.

I can't find any problem.

<DataGrid DataSource="@exceptions" AutoGenerateColumns="false"  SelectionMode="@GridSelectionMode.None" CellSelectionAnimationMode="@CellSelectionAnimationMode.None"  EditMode="@EditModeType.None" >
     <TextColumn Field="ApplicationName" />
     <TextColumn Field="ApplicationUser" />
     <TextColumn Field="MachineName" HeaderText="Server" />
     <TextColumn Field="ExceptionMessage" />
     <TextColumn Field="EnvironmentName" />
     <TemplateColumn Field="Id" HeaderText="Order History">
         <Template>
             <div>
                 <button @onclick="() => OpenException((ProblemReportGridViewModel)context.RowItem)">Detail</button>
             </div>
         </Template>
     </TemplateColumn>
 </DataGrid>
0
Michael Mangelschots
Michael Mangelschots answered on Sep 30, 2020 7:17 AM

Andrew,

We are disappointed that we have to resort to Javascript to get a simple button in the grid. One of the main reasons why we decided to use Blazor was to limit the use of Javascript.

Are you planning to add this feature in the future, or will we be forced to use Javascript for template columns?

0
Michael Mangelschots
Michael Mangelschots answered on Sep 28, 2020 5:44 AM

Andrew,

Using the following code I am still unable to see a button in my grid.

<DataGrid DataSource="@exceptions" AutoGenerateColumns="false" Height="100%" Width="100%">
    <TextColumn Field="ApplicationName" />
    <TextColumn Field="ApplicationUser" />
    <TextColumn Field="MachineName" HeaderText="Server" />
    <TextColumn Field="ExceptionMessage" />
    <TextColumn Field="EnvironmentName" />
    <TextColumn Field="Severity" />
    <TemplateColumn Field="Id" HeaderText="Order History">
        <Template>
            <RenderFragment>
                <div style="width100%height70pxbackgroundtransparent">
                    <button type="button">Click Me!</button>
                </div>
            </RenderFragment>
        </Template>
    </TemplateColumn>
</DataGrid>

Have you been able to get a button in a grid, if so can you send me the code snippet so I can determine what I am doing wrong.

0
Michael Mangelschots
Michael Mangelschots answered on Sep 25, 2020 8:24 AM

Hello Andrew,

<TemplateColumn Field="OrderHistory" Width="@("*>180")" HeaderText="Order History" > <Template> <RenderFragment> <div style="width: 100%; height: 70px; background: transparent"> <Sparkline Height="100%" Width="100%" DataSource="@((context.RowItem as Product).OrderHistory)" DisplayType="SparklineDisplayType.Line" ValueMemberPath="Sold" LabelMemberPath="Week" Brush="rgb(21, 190, 6)"> </Sparkline> </div> </RenderFragment> </Template> </TemplateColumn>

What is the <RenderFragment>? If I leave this out I still don't see my button. If I want to use it I get an error that it does not know this component.

0
Michael Mangelschots
Michael Mangelschots answered on Jan 15, 2015 8:04 AM

Thanks a lot for the quick reply. We will try this out.

Kind regards,

Michael

0
Michael Mangelschots
Michael Mangelschots answered on Aug 8, 2014 8:19 AM

Thanks a lot for the information Stamen.

Looks good, I'll try it asap.

Michael

0
Michael Mangelschots
Michael Mangelschots answered on Aug 7, 2014 9:45 AM

Hello Stamen,

Thanks for the quick reply!

Yes, our scenario will involve Paging. Won't the same "dataFiltered" event nog be usefull with paging ?

Best regards,

Michael