Add Column for QR Code Generator in Data Grid
Good Day to All,
It is possible to add column for QR Code Generator?, the concept is when adding Item Code using barcode scanner then click tab to automatically generate QR Code for Item Code?, please check image below.
Thanks in Advance :)
Nelson
|
<SfGrid DataSource="@Employees" Toolbar="@(new List<string>() { "Add", "Delete", "Update", "Cancel" })" Height="315">
<GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true" Mode="EditMode.Batch"></GridEditSettings>
<GridColumns>
<GridColumn HeaderText="Employee Image" TextAlign="TextAlign.Center" Width="120">
<Template>
@{
var employee = (context as EmployeeData);
<div class="image">
<SfQRCodeGenerator Width="200px" Height="150px" Value="@(employee.EmployeeID.ToString())"></SfQRCodeGenerator>
</div>
}
</Template>
</GridColumn>
<GridColumn Field=@nameof(EmployeeData.EmployeeID) HeaderText="Employee ID" IsPrimaryKey="true" DefaultValue="@(Employees.Max(x=>x.EmployeeID) + 1)" TextAlign="TextAlign.Right" Width="120"></GridColumn>
<GridColumn Field=@nameof(EmployeeData.HireDate) HeaderText="Hire Date" Format="d" TextAlign="TextAlign.Right" Width="150"></GridColumn>
</GridColumns>
</SfGrid>
|
Good Day Mr. Vignesh Natarajan,
Thanks for the reply.. :)
Nelson
Good Day,
How can i remove QR Code name?
Thanks in Advance :)
Nelson
|
<SfGrid DataSource="@Employees" Toolbar="@(new List<string>() { "Add", "Delete", "Update", "Cancel" })" Height="315">
<GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true" Mode="EditMode.Batch"></GridEditSettings>
<GridColumns>
<GridColumn HeaderText="Employee Image" TextAlign="TextAlign.Center" Width="120">
<Template>
@{
var employee = (context as EmployeeData);
<div class="image">
<SfQRCodeGenerator Width="200px" Height="150px" Value="@(employee.FirstName)">
<QRCodeGeneratorDisplayText Text=" "></QRCodeGeneratorDisplayText>
</SfQRCodeGenerator>
</div>
}
</Template>
</GridColumn>
<GridColumn Field=@nameof(EmployeeData.EmployeeID) HeaderText="Employee ID" IsPrimaryKey="true" DefaultValue="@(Employees.Max(x=>x.EmployeeID) + 1)" TextAlign="TextAlign.Right" Width="120"></GridColumn>
<GridColumn Field=@nameof(EmployeeData.HireDate) HeaderText="Hire Date" Format="d" TextAlign="TextAlign.Right" Width="150"></GridColumn>
</GridColumns>
</SfGrid>
|
Hello Sir Vignesh Natarajan,
Thanks for quick reply :)
I have another question..
How can i add column for Item image and
when adding Item Code using barcode scanner then click tab to automatically
add item image for Item Code?, it is possible when i click item image it will zoom in or it will zoom into large image?
Thanks again
Nelson
- Do you want to insert the record automatically with ItemCode value while scanning the barcode scanner?
- Or do you have requirement to show the image column in Grid while inserting a record?
- Share more details about your requirement with pictorial representation.
|
<SfGrid DataSource="@Employees" Toolbar="@(new List<string>() { "Add", "Delete", "Update", "Cancel" })" Height="315">
<GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true" Mode="EditMode.Batch"></GridEditSettings>
<GridColumns>
<GridColumn HeaderText="Employee Image" TextAlign="TextAlign.Center" Width="120">
<Template>
@{
var employee = (context as EmployeeData);
<div class="image" @onclick="@(()=>openDialog(employee.FirstName))">
<SfQRCodeGenerator Width="200px" Height="150px" Value="@(employee.FirstName)">
<QRCodeGeneratorDisplayText Text=" "></QRCodeGeneratorDisplayText>
</SfQRCodeGenerator>
</div>
}
</Template>
</GridColumn>
<GridColumn Field=@nameof(EmployeeData.EmployeeID) HeaderText="Employee ID" IsPrimaryKey="true" DefaultValue="@(Employees.Max(x=>x.EmployeeID) + 1)" TextAlign="TextAlign.Right" Width="120"></GridColumn>
<GridColumn Field=@nameof(EmployeeData.HireDate) HeaderText="Hire Date" Format="d" TextAlign="TextAlign.Right" Width="150"></GridColumn>
</GridColumns>
</SfGrid>
<style>
.image img {
height: 55px;
width: 55px;
border-radius: 50px;
box-shadow: inset 0 0 1px #e0e0e0, inset 0 0 14px rgba(0, 0, 0, 0.2);
}
</style>
<SfDialog Width="300px" IsModal="true" @bind-Visible="@IsVisible">
<DialogEvents OnOverlayClick="@OnOverlayclick">
</DialogEvents>
<DialogTemplates>
<Content>
<SfQRCodeGenerator Width="250px" Height="250px" Value="@(QRValue)">
<QRCodeGeneratorDisplayText Text=" "></QRCodeGeneratorDisplayText>
</SfQRCodeGenerator>
</Content>
</DialogTemplates>
</SfDialog>
@code{
public List<EmployeeData> Employees { get; set; }
public string Check { get; set; } = "";
public string QRValue { get; set; } = "";
private bool IsVisible { get; set; } = false;
private void openDialog(string value)
{
QRValue = value;
this.IsVisible = true;
}
private void OnOverlayclick(MouseEventArgs arg)
{
this.IsVisible = false;
}
|
|
|
Good Day Sir Vignesh Natarajan,
Thanks for the reply..
I mean another column for Image saved in sql server, not in QR Code column..
But thanks i know now about how to enlarge image icon..
Nelson :)
Good Day Sir Vignesh Natarajan,
My question is how can extend color in Nav Menu?
Thanks in Advance..
Nelson
- Are you facing the reported issue while using our Syncfusion MenuBar component.
- Or facing the reported issue with default Blazor NavMenu component?.
- Share more details about your Nav Menu bar.
Good Day Vignesh Natarajan,
Please check the file thanks..
Nelson
Attachment: For_Blazor_nav_menu_93301b48.rar
|
.sidebar {
width: 250px;
/*height: 100vh;*/
position: sticky;
top: 0;
}
|
- 12 Replies
- 2 Participants
-
NT Nelson Tan
- Sep 25, 2021 02:52 PM UTC
- Oct 15, 2021 06:41 AM UTC