问题
I have a table with multicolumn and record is inserted with Pipe sign. This pipe sign is a indicator to insert a line break. "Column Name:Bedroom" "Record is like Flooring: Vitrified Tiles|Wall : Distemper|Ceiling : Oil Bound Distemper". similarly i have multiple columns with same type of record.
I want to display the records as shown in image below
I don't want to use loop and lengthy code. instead i would prefer List/Dictionary and in aspx page i would like to use Repeater. Code i am trying is available here for better understanding. I have added a # tag to identify the end of first column.
string Specs = dtprop.Rows[0]["SpecBedRoom"] + "#" + dtprop.Rows[0]["SpecLivingRoom"];
Specs = Specs.Replace("|", "<br/>");
List<string> InnerSpecs = Specs.Split('#').ToList<string>();
Dictionary<string, string> d = new Dictionary<string, string>();
d.Add("Bedroom", InnerSpecs[0].ToString());
d.Add("Living Room", InnerSpecs[1].ToString());
rptrInnerSpecs.DataSource = d;
rptrInnerSpecs.DataBind();
Your expertise is required for this.Please suggest.
来源:https://stackoverflow.com/questions/58669733/generate-list-with-splitted-record-and-adding-key-in-c-sharp