|
Sounds like Sharepoint Online. For $5 per month per user.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
Is there a way to have a windows form and add web controls to be able to use the bullet style change styles without needing for it to be on the web? I am new to programming and do not know asp.net, html, or WPF to do it one of those ways. Thank you
|
|
|
|
|
|
To answer the question "can you use web controls in a Windows forms app?", to keep things simple, no, you can't.
As Richard said, if you need to display bulleted data, you can look into a RichTextBox control. If you need to display something else, you're going to have to describe, in detail, what you want to display and in what format.
|
|
|
|
|
Technically, you can, although I would recommend against it. If you need a dynamic website, then you're going to need a webserver somewhere. If, however, your webpage is static, you can simply host a webcontrol in your form and point it at a local index.html file and that would be displayed.
Saying that, while you could technically do this; save yourself a lot of pain, and use a RichTextBox instead.
|
|
|
|
|
That's why I said "to keep things simple".
|
|
|
|
|
|
I have used a great resource for something similar. It doesn't support everything (such as css) but if you are looking to create html aware forms in Windows.Forms, the HTMLRenderer NuGet packages are perfect (you may be stuck with .NET Framework as the support for .NET Core is questionable). It is also specific to HTML 4.1. I believe it does support bulleted lists as long as you don't mind that you can't use CSS. (It says it can but CSS is only partially implemented so many of its features do not work).
EDIT: Here is an image of an example control I made with these packages which make use of bulleted lists:
ibb.co/6b4JSJQ
[edit]Link made visible (your choice if you follow it, but it seems to be some link shortening image site) : OriginalGriff[/edit]
|
|
|
|
|
Be careful when posting links (especially links that look like link shorteners) - your original held what is called a "hidden link": no text so the link can't be seen, much less clicked on. Normally, that would have been an open-and-shut moderation, and your account would disappear as a spammer.
If you must post image links, then expect two things: lots of moderation and false positive reports against you - particularly when the link looks like yours does and you can't tell what is at the other end. In deference to your length of membership, I spun up a VM to check it, but many will not want to do that and will report your account as spam instead. That will mean you get shown the door ... so it's in your interest not to look suspicious!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Ok... thanks for the heads up. I copied the embedded link provided to me by imgbb, not aware of this issue. I wanted to just embed an image but there doesn't seem to be a direct way to do that. I just wanted to demonstrate the capabilities of the solution I was proposing. The software I showed in the picture isn't even available... (at least not yet), so I am not sure how that could qualify as spam (other than in appearance).
|
|
|
|
|
You can't post images directly, except in a very limited number of (highly policed) forums - this is a SFW site and nobody wants your corporate net nazis to get offended by some of the images that would get posted ... we have visitors that would post some truely offensive images if given the chance ...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I've just seen you post, so sorry for the late reply.
The answer is yes, you can. Blazor WASM (Web Assembly) enables you to do just that. I have written an article recently that demonstrates this with WPF, however WinForms can do the same. Here is the article: Blazing.Mvvm - Blazor WASM & Blazor Hybrid using the Community Toolkit[^] - ignore the fact that the article focuses on MVVM. The key thing for you, in the article, is not only proof of concept, but also how you can interact with the Blazor part from within your WinForms app and vice versa. IT is made possible by the BlazorWebView control.
Microsoft have an article that shows you how to host Blazor within WinForms: Build a Windows Forms Blazor app | Microsoft Learn[^].
Be aware though, to do this, you need to work with .Net 7.0+, not .Net Framework. However, if you need to move from .Net Framework to .Net, then your app will receive an immediate performance boost due to improvements made to .Net - no legacy support.
Graeme
"I fear not the man who has practiced ten thousand kicks one time, but I fear the man that has practiced one kick ten thousand times!" - Bruce Lee
|
|
|
|
|
Quote: i need to help create master detail form in winform means when i click on orderno then it will be show order detail like table 2 data on gridview like item name,rice and quantity
|
|
|
|
|
OK, what have you tried?
Where are you stuck?
What help do you need?
This isn't a difficult problem if you know what you are doing, but there are a lot of different ways it can be done - so we need to know what you have at the moment, and what is stopping you from progressing. Otherwise, what we suggest could take you off in a direction that just doesn't work well with the rest of your code - the way you do things is likely to be very different from the way I would!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Actually i created 2 tables ordm in this i created primary key is orderno ,orderdate,credit term and days and ordc i created foreign key is orderno,item name,price and value in sql server then i created 2 forms for both table in winform then i connected both of them with sql server,but i need to show ordc all column data in gridview with the help of orderno like when i enter order in ordm so it can save data in ordc grid with order detail.but order dont have to show in grid.
|
|
|
|
|
OK, so you have two tables in an SQL DB, and you have imported the data into your app.
How? DataSet, DataTable, Data Reader? Is it loaded into classes your created to hold them, or still in tabular form?
You have two DataGridViews, you want one to display all the items from one DB table, and when you select one, its details from the second DB table should be displayed in the second DGV.
How are the two tables "linked"? What are you using as the DataSource for the DGV's?
What have you done so far to make the tables displays work?
See what I mean about there being a lot of different ways to do this?
Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with - we get no other context for your project.
Imagine this: you go for a drive in the country, but you have a problem with the car. You call the garage, say "it broke" and turn off your phone. How long will you be waiting before the garage arrives with the right bits and tools to fix the car given they don't know what make or model it is, who you are, what happened when it all went wrong, or even where you are?
That's what you've done here. So stop typing as little as possible and try explaining things to people who have no way to access your project!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
first i created 2 tables in sql and then connected them with orderno then i connect sql with my winform with sqlconnection and taake all column with sqlcommand then i got all data on grid view with dataadapter then load with datatable and then use data gridview datasourse but this process show both table on gridview but i just want to show child table on grid with the help of orderno.
|
|
|
|
|
OK, so we have some information now: you used a DataAdapter to fill a DataTable with both tables results, then set that as the datasource for both DGVs.
That's the first problem: you need to separate the two SQL Tables into different DataTables and use them to fill the two DataGridViews with different data.
When you have the separate tables, what do you know about BindingSources? Have you used them?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
yes i used datasource in connectionstring which pass as a parameter in sqlconnection constructer then bind data in this connectionstring.
|
|
|
|
|
I'm impressed about the patience of OriginalGriff ...
For me you explain more or less nothing - it could be very useful if you provide the significant code. Perhaps we could help you much better - or don't ypu have any code ?
|
|
|
|
|
It is a little slow going, isn't it?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
No, the connection and it's string use a different idea of "dataSource" - a DGV (and all other data aware controls) have a DataSource Property: DataGridView.DataSource Property (System.Windows.Forms) | Microsoft Learn[^]
Your previous post says you are using that to "get the data into the DGV".
I assume that you are doing something like:
MyDataAdapter.Fill(MyDataTable);
MyMasterDGV.DataSource = myDataTable;
MyDetailDGV.DataSource = myDataTable; Is that correct?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
yes exatly i did this
private string connectionString = "Data Source=DESKTOP-5GRDQ7C\\SQLEXPRESS;Initial Catalog=Orders;Integrated Security=True";
private SqlDataAdapter masterDataAdapter;
private SqlDataAdapter detailDataAdapter;
private DataSet dataSet;
public Form1()
{
InitializeComponent();
}
private void LoadMasterData()
{
using (SqlConnection connection = new SqlConnection(connectionString))
{
string query = "SELECT * FROM ordm";
SqlDataAdapter adapter = new SqlDataAdapter(query, connection);
DataTable dataTable = new DataTable();
adapter.Fill(dataTable);
masterDataGridView.DataSource = dataTable;
}
}
private void LoadData()
{
using (SqlConnection connection = new SqlConnection(connectionString))
{
string ordmQuery = "SELECT * FROM ORDM";
masterDataAdapter = new SqlDataAdapter(ordmQuery, connection);
masterDataAdapter.Fill(dataSet, "ORDM");
string ordcQuery = "SELECT * FROM ORDC";
detailDataAdapter = new SqlDataAdapter(ordcQuery, connection);
detailDataAdapter.Fill(dataSet, "ORDC");
}
DataColumn parentColumn = dataSet.Tables["ORDM"].Columns["ORD_NO"];
DataColumn childColumn = dataSet.Tables["ORDC"].Columns["ORD_NO"];
DataRelation relation = new DataRelation("ORDM_ORDC_Relation", parentColumn, childColumn);
dataSet.Relations.Add(relation);
}
private void Form1_Load(object sender, EventArgs e)
{
LoadMasterData();
dataSet = new DataSet();
LoadData();
masterDataGridView.DataSource = dataSet.Tables["ORDM"];
masterDataGridView.SelectionChanged += masterDataGridView_SelectionChanged_1;
}
private void masterDataGridView_SelectionChanged_1(object sender, EventArgs e)
{
if (masterDataGridView.SelectedRows.Count > 0)
{
string orderNumber = Convert.ToString(masterDataGridView.SelectedRows[0].Cells["ordcol"].Value);
LoadChildData(orderNumber);
}
}
private void LoadChildData(string orderNumber)
{
using (SqlConnection connection = new SqlConnection(connectionString))
{
string query = $"SELECT * FROM ordc WHERE ord_no = ord_no";
SqlDataAdapter adapter = new SqlDataAdapter(query, connection);
DataTable dataTable = new DataTable();
adapter.Fill(dataTable);
childDataGridView.DataSource = dataTable;
}
}
}
modified 27-Jul-23 5:38am.
|
|
|
|
|
I've edited your question and added a code block - this engages the syntax highlighter, preserves the indentation, and makes it easier to read - edit it yourself and you'll see what I did (it's only a couple of clicks to do it and it makes everybody's life easier).
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
OK, that's very definitely the long way round - you don't need the events as if you hook up the DataTables to the DGV correctly using BindingSources, the system will do it all for you.
Do you want me to show you how I would do it, or do you want to fix this line of code?
string query = $"SELECT * FROM ordc WHERE ord_no = ord_no";
If it's the later, then there are two ways to do it - the incredibly dangerous way you are trying to do it, and the proper way which means users can't destroy your database?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|